Skip to content

Commit 6eecd16

Browse files
committed
Test ++$var and --$var
1 parent 5352e59 commit 6eecd16

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

t/nqp/013-op.t

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# checking basic operands and circumfix:( )
22

3-
plan(33);
3+
plan(37);
44

55
##Additive operators
66
ok( 1+2 == 3, 'Checking addition 1+2');
@@ -34,6 +34,13 @@ ok( $x == 1 );
3434
ok( $x-- == 1 );
3535
ok( $x == 0 );
3636

37+
##Prefix operators
38+
my $y := 0;
39+
ok( ++$y == 1, 'prefix ++ returns right value');
40+
ok( $y == 1, 'prefix ++ increments variable');
41+
ok( --$y == 0, 'prefix -- returns right value');
42+
ok( $y == 0, 'prefix -- decrements variable');
43+
3744
##Relational operators
3845
ok( ?(1 < 2) );
3946
ok( !(2 < 1) );

0 commit comments

Comments
 (0)