add __not__ and test the new bool typemaps
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@8349 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
06a949da6d
commit
38c8cf2cb8
2 changed files with 19 additions and 6 deletions
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/perl -w
|
||||
use strict;
|
||||
use Test::More tests => 26;
|
||||
use Test::More tests => 28;
|
||||
use operator_overload;
|
||||
|
||||
pass("loaded");
|
||||
|
|
@ -108,10 +108,18 @@ $op->{i} = 7;
|
|||
$op--;
|
||||
is($op->{i}, 6, "operator decrement");
|
||||
|
||||
# inverse operator
|
||||
# neg operator
|
||||
$op->{i} = 3;
|
||||
$op2 = -$op;
|
||||
is($op2->{i}, -3, "operator inverse");
|
||||
is($op2->{i}, -3, "operator neg");
|
||||
|
||||
# not operator
|
||||
$op->{i} = 0;
|
||||
is(!$op, !0, "operator not");
|
||||
|
||||
$op->{i} = 1;
|
||||
is(!$op, !1, "operator not");
|
||||
|
||||
|
||||
# TODO : {
|
||||
# local $TODO = "I can't get Perl to trigger overloaded 'and' and 'or'";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue