Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add tests for Array.perl, for both implicit and explicitly constraine…
…d values
  • Loading branch information
lizmat committed Jul 8, 2013
1 parent 6127abe commit 4753065
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions S32-array/perl.t
@@ -0,0 +1,30 @@
use v6;
use Test;

plan 6;

#?pugs todo "cannot roundtrip arrays"
#?niecza todo "cannot roundtrip arrays"
# simple array
{
my @a = 1,2;
is @a.perl, 'Array.new(1, 2)',
'can we serialize a simple array';
my $ra = eval(@a.perl);
is_deeply $ra, @a, 'can we roundtrip simple array';
ok $ra.of =:= Mu, 'make sure any value can be stored';
} #3

#?pugs skip "cannot roundtrip arrays with constrained values"
#?niecza skip "cannot roundtrip arrays with constrained values"
# array with constrained values
{
my Int @a = 1,2;
is @a.perl, 'Array[Int].new(1, 2)',
'can we serialize a array with constrained values';
my $ra = eval(@a.perl);
is_deeply $ra, @a, 'can we roundtrip array constrained values';
ok $ra.of =:= Int, 'make sure roundtripped values are Int';
} #3

#vim: ft=perl6

0 comments on commit 4753065

Please sign in to comment.