Permalink
Browse files

[t/spec] don't rely on exact .perl value

git-svn-id: http://svn.pugscode.org/pugs@25873 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information...
1 parent 0eaa0ad commit 6d9b707cf3181fe83fdf20d6662b84d32d3ffbea moritz committed Mar 17, 2009
Showing with 11 additions and 11 deletions.
  1. +11 −11 S04-declarations/state.t
View
@@ -55,38 +55,38 @@ plan 30;
my @bar = 1,2,3;
sub swatest {
state (@foo) = @bar;
- my $x = @foo.perl;
+ my $x = @foo.join('|');
@foo[0]++;
return $x
}
- is swatest(), '[1, 2, 3]', 'array state initialized correctly';
- is swatest(), '[2, 2, 3]', 'array state retained between calls';
+ is swatest(), '1|2|3', 'array state initialized correctly';
+ is swatest(), '2|2|3', 'array state retained between calls';
}
# state with arrays.
{
sub swainit_sub { 1,2,3 }
sub swatest2 {
state (@foo) = swainit_sub();
- my $x = @foo.perl;
+ my $x = @foo.join('|');
@foo[0]++;
return $x
}
- is swatest2(), '[1, 2, 3]', 'array state initialized from call correctly';
- is swatest2(), '[2, 2, 3]', 'array state retained between calls';
+ is swatest2(), '1|2|3', 'array state initialized from call correctly';
+ is swatest2(), '2|2|3', 'array state retained between calls';
}
# (state @foo) = @bar differs from state @foo = @bar
{
my @bar = 1,2,3;
sub swatest3 {
(state @foo) = @bar;
- my $x = @foo.perl;
+ my $x = @foo.join('|');
@foo[0]++;
return $x
}
- is swatest3(), '[1, 2, 3]', '(state @foo) = @bar is not state @foo = @bar';
- is swatest3(), '[1, 2, 3]', '(state @foo) = @bar is not state @foo = @bar';
+ is swatest3(), '1|2|3', '(state @foo) = @bar is not state @foo = @bar';
+ is swatest3(), '1|2|3', '(state @foo) = @bar is not state @foo = @bar';
}
# RHS of state is only run once per init
@@ -191,8 +191,8 @@ plan 30;
return (+$svar, +$svar2);
};
- is(step().perl, "[43, 41]", "chained state (#1)");
- is(step().perl, "[44, 40]", "chained state (#2)");
+ is(step().join('|'), "43|41", "chained state (#1)");
+ is(step().join('|'), "44|40", "chained state (#2)");
}
# state in cloned closures

0 comments on commit 6d9b707

Please sign in to comment.