added __rsub__() and test for reversed subtraction operator
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@10337 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
8c7d3c7ae3
commit
128880ea1d
2 changed files with 9 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
|||
#!/usr/bin/perl -w
|
||||
use strict;
|
||||
use Test::More tests => 38;
|
||||
use Test::More tests => 39;
|
||||
|
||||
use operator_overload;
|
||||
|
||||
|
|
@ -66,6 +66,11 @@ $op2->{i} = 3;
|
|||
$op = $op3 - $op2;
|
||||
is($op->{i}, 3, "operator subtraction");
|
||||
|
||||
# reversed subtraction operator (with int)
|
||||
$op3->{i} = 3;
|
||||
$op = 6 - $op3;
|
||||
is($op->{i}, 3, "reversed operator subtraction (with int)");
|
||||
|
||||
# subtractive assignment operator
|
||||
$op->{i} = 6;
|
||||
$op2->{i} = 3;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue