Skip to content

Commit fe60380

Browse files
committed
added test for increment and decrement operators
1 parent 2085077 commit fe60380

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

S02-types/int-uint.t

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use Test;
44
# L<S09/Sized types/Sized low-level types are named most generally by appending the number of bits to a generic low-level type name>
55

66
my @inttypes = map {"int$_", "uint$_"}, <1 2 4 8 16 32 64>;
7-
plan 8 * @inttypes;
7+
plan 10 * @inttypes;
88

99
for @inttypes -> $type {
1010
eval_lives_ok "my $type \$var; 1", "Type $type lives"
@@ -32,6 +32,10 @@ for @inttypes -> $type {
3232
eval_dies_ok("my $type \$var = 'foo'", "$type cannot be a string");
3333
eval_dies_ok("my $type \$var = 42.1", "$type cannot be non-integer");
3434
eval_dies_ok("my $type \$var = NaN", "$type cannot be NaN");
35+
36+
#?rakudo 2 skip "Cannot modify an immutable value"
37+
is(eval("my $type \$var = 0; \$var++; \$var"), 1, "$type \$var++ works");
38+
is(eval("my $type \$var = 1; \$var--; \$var"), 0, "$type \$var-- works");
3539
}
3640

3741
# vim: ft=perl6

0 commit comments

Comments
 (0)