Skip to content

Commit

Permalink
[t/spec] Unfudge a bunch of hash interpolation tests.
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.pugscode.org/pugs@30298 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information
jnthn committed Apr 4, 2010
1 parent 04f9511 commit 67e5de7
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions S02-literals/hash-interpolation.t
Expand Up @@ -4,14 +4,12 @@ use Test;

plan 10;

#?rakudo todo 'Hash interpolation with %hash<literal>'
{
my %hash = (a => 1, b => 2);
is "%hash<a>", 1, '"%hash<a>" works';
is "<%hash<a>>", '<1>', '"<%hash<a>>" works';
}

#?rakudo todo 'interpolation with subscripts'
{
my $hash = { a => 1, b => 2 };
is "$hash<a>", 1, '"$hash<a>" works';
Expand All @@ -21,13 +19,12 @@ plan 10;
{
# L<S02/Literals/In order to interpolate an entire hash>
my %hash = { a=> 1, b => 2 };
#?rakudo 2 todo 'hash (ref) interpolation'
#?rakudo 2 skip 'zen hash slice'
is "%hash{}", "a\t1\nb\t2\n", 'interpolation with curly braces';
is "%hash<>", "a\t1\nb\t2\n", 'interpolation with angle brackets';
is "%hash", '%hash', 'no interpolation';
}

#?rakudo todo 'Hash interpolation'
{
# "%hash{a}" actually calls a(). Test that.
my %hash = (a => 1, b => 2);
Expand All @@ -36,8 +33,8 @@ plan 10;
}
is "%hash{do_a}", "2", '%hash{do_a} calls do_a()';

is "%hash{'b'}", "b", 'can quote hash indexes in interpolations 1';
is "%hash{"b"}", "b", 'can quote hash indexes in interpolations 2';
is "%hash{'b'}", "2", 'can quote hash indexes in interpolations 1';
is "%hash{"b"}", "2", 'can quote hash indexes in interpolations 2';
}

# vim: ft=perl6

0 comments on commit 67e5de7

Please sign in to comment.