Daniel Moore patch - more operator overloading support

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@9154 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2006-06-12 21:07:38 +00:00
commit 6c9455d440
2 changed files with 25 additions and 1 deletions

View file

@ -1,6 +1,6 @@
#!/usr/bin/perl -w
use strict;
use Test::More tests => 28;
use Test::More tests => 36;
use operator_overload;
@ -99,6 +99,15 @@ $op->{i} = 3;
ok_not(($op2 > $op), "operator greater than");
ok_not(($op > $op2), "operator greater than");
# greater than or equal operator
$op->{i} = 8;
$op2->{i} = 3;
ok($op >= $op2, "operator greater than or equal");
ok_not(($op2 >= $op), "operator greater than or equal");
$op->{i} = 3;
ok(($op2 >= $op), "operator greater than or equal");
ok(($op >= $op2), "operator greater than or equal");
# lesser than operator
$op2->{i} = 8;
$op->{i} = 3;
@ -108,6 +117,15 @@ $op2->{i} = 3;
ok_not(($op2 < $op), "operator lesser than");
ok_not(($op < $op2), "operator lesser than");
# less than or equal operator
$op2->{i} = 8;
$op->{i} = 3;
ok($op <= $op2, "operator lesser than or equal");
ok_not(($op2 <= $op), "operator lesser than or equal");
$op2->{i} = 3;
ok(($op2 <= $op), "operator less than or equal");
ok(($op <= $op2), "operator less than or equal");
# increment operator
$op->{i} = 7;
$op++;