Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add some unsigned native int specific tests
  • Loading branch information
lizmat committed Mar 16, 2015
1 parent 0bfd751 commit 6f15520
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion S09-typed-arrays/native-int.t
Expand Up @@ -7,7 +7,7 @@ if $*KERNEL.bits == 64 {
@uint.push: uint64;
}

plan (@int + @uint) * 126;
plan (@int + @uint) * 126 + @uint * 2;

# Basic native int array tests.
for @int,@uint -> $T {
Expand Down Expand Up @@ -213,3 +213,14 @@ for @int,@uint -> $T {
message => 'This type cannot unbox to a native integer',
"List-assigning incompatible untyped array to $t array dies";
}

# some unsigned native int tests
for @uint -> $T {
my $t = $T.^name;
diag "Testing $t array for unsigned features";

my @arr := array[$T].new;
is (@arr[0] = -1), -1, "assigning -1 on $t array passes value on through?";
#?rakudo skip 'highest bit length stays negative, RT #124088'
ok @arr[0] > 0, "negative value on $t array becomes positive";
}

0 comments on commit 6f15520

Please sign in to comment.