Skip to content

Commit

Permalink
keep up with .perl and []/{} changes
Browse files Browse the repository at this point in the history
  • Loading branch information
TimToady committed Apr 2, 2015
1 parent 72ca1c1 commit 493af7f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion S02-types/pair.t
Expand Up @@ -333,7 +333,7 @@ Note, "non-chaining binary" was later renamed to "structural infix".
isa_ok (a => [3,4]).invert[0].key, Int, 'Pair.invert.key type';
is (a => [3,4]).invert».value, 'a a', 'Pair.invert splits positional values and dups keys';

is <a b c>.pairs.invert.perl, '("a" => 0, "b" => 1, "c" => 2).list', 'list of array pairs can be inverted';
is <a b c>.pairs.invert.perl, '(:a(0), :b(1), :c(2))', 'list of array pairs can be inverted';
is { a => (1,2), b => <x y z> }.pairs.invert.sort.gist, '1 => a 2 => a x => b y => b z => b', 'list of hash pairs can be inverted';
}

Expand Down
4 changes: 2 additions & 2 deletions S32-array/perl.t
Expand Up @@ -7,11 +7,11 @@ plan 6;
# simple array
{
my @a = 1,2;
is @a.perl, 'Array.new(1, 2)',
is @a.perl, '[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 =:= Any, 'make sure any value can be stored';
ok $ra.of =:= Mu, 'make sure any value can be stored';
} #3

#?niecza skip "cannot roundtrip arrays with constrained values"
Expand Down
4 changes: 2 additions & 2 deletions S32-hash/perl.t
Expand Up @@ -7,10 +7,10 @@ plan 12;
# simple hash
{
my %h = a => 1, b => 2;
is %h.perl,'("a" => 1, "b" => 2).hash'|'("b" => 2, "a" => 1).hash',
is %h.perl,'{:a(1), :b(2)}{}',
'can we serialize a simple hash';
my $rh = EVAL(%h.perl);
is_deeply $rh, %h, 'can we roundtrip simple hash';
is_deeply $rh, $%h, 'can we roundtrip simple hash';
ok $rh.of =:= Mu, 'make sure any value can be stored';
ok $rh.keyof =:= Any, 'make sure keys are Any';
} #4
Expand Down

0 comments on commit 493af7f

Please sign in to comment.