tests: extends base_combined_assignment and test_ffi_c_operators
authorJean Privat <jean@pryen.org>
Wed, 15 Apr 2015 05:39:56 +0000 (12:39 +0700)
committerJean Privat <jean@pryen.org>
Wed, 15 Apr 2015 05:43:58 +0000 (12:43 +0700)
Signed-off-by: Jean Privat <jean@pryen.org>

tests/base_combined_assignment.nit
tests/sav/base_combined_assignment.res
tests/sav/test_ffi_c_operators.res
tests/test_ffi_c_operators.nit

index 12e1481..942c8ca 100644 (file)
@@ -20,3 +20,15 @@ var i = 1#alt1#
 #alt1#var i: Object = 1
 i += 2
 i.output
+i -= 1
+i.output
+i *= 3
+i.output
+i /= 2
+i.output
+i %= 5
+i.output
+i <<= 3
+i.output
+i >>= 2
+i.output
index ecc608f..271589e 100644 (file)
@@ -26,6 +26,11 @@ class A
                return new_A( s + o );
        `}
 
+       fun +: A import value, A `{
+               int s = A_value(recv);
+               return new_A(+s);
+       `}
+
        fun -( other : A ) : A import value, A `{
                int s = A_value( recv );
                int o = A_value( other );
@@ -163,4 +168,5 @@ print a[ 52 ] # 52
 a[ 74 ] = new A( 96 )
 print a # 96
 
+print(+(new A(123)))
 print(-(new A(123)))