diff options
Diffstat (limited to 'Examples/test-suite/perl5/operator_overload_runme.pl')
-rw-r--r-- | Examples/test-suite/perl5/operator_overload_runme.pl | 29 |
1 files changed, 10 insertions, 19 deletions
diff --git a/Examples/test-suite/perl5/operator_overload_runme.pl b/Examples/test-suite/perl5/operator_overload_runme.pl index ba3f33a64..43a77a961 100644 --- a/Examples/test-suite/perl5/operator_overload_runme.pl +++ b/Examples/test-suite/perl5/operator_overload_runme.pl @@ -4,15 +4,6 @@ use Test::More tests => 39; use operator_overload; -# Workaround for -# ok( not (expression) , "test description" ); -# does not working in older versions of Perl, eg 5.004_04 -sub ok_not ($;$) { - my($test, $name) = @_; - $test = not $test; - ok($test, $name); -} - pass("loaded"); # first check all the operators are implemented correctly from pure C++ code @@ -30,7 +21,7 @@ isa_ok($op2, "operator_overload::Op"); $op->{i} = 5; $op2->{i} = 3; -ok_not(($op == $op2), "operator equal: not equal"); +ok(not($op == $op2), "operator equal: not equal"); $op->{i} = 3; ok(($op == $op2), "operator equal: equal"); @@ -42,7 +33,7 @@ $op2->{i} = 3; ok(($op != $op2), "operator not equal: not equal"); $op->{i} = 3; -ok_not(($op != $op2), "operator not equal: equal"); +ok(not($op != $op2), "operator not equal: equal"); # stringify operator $op->{i} = 3; @@ -99,16 +90,16 @@ is($op3->{i}, 2, "operator modulus"); $op->{i} = 8; $op2->{i} = 3; ok($op > $op2, "operator greater than"); -ok_not(($op2 > $op), "operator greater than"); +ok(not($op2 > $op), "operator greater than"); $op->{i} = 3; -ok_not(($op2 > $op), "operator greater than"); -ok_not(($op > $op2), "operator greater than"); +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"); +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"); @@ -117,16 +108,16 @@ ok(($op >= $op2), "operator greater than or equal"); $op2->{i} = 8; $op->{i} = 3; ok($op < $op2, "operator lesser than"); -ok_not(($op2 < $op), "operator lesser than"); +ok(not($op2 < $op), "operator lesser than"); $op2->{i} = 3; -ok_not(($op2 < $op), "operator lesser than"); -ok_not(($op < $op2), "operator lesser than"); +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"); +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"); |