Skip to content

Commit 49ce219

Browse files
committed
added test descriptions and another "flip" test
1 parent 489ebb2 commit 49ce219

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

integration/advent2010-day08.t

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,21 +4,29 @@ use v6;
44

55
use Test;
66

7-
plan 7;
7+
plan 8;
88

9-
is do {flip "hello"}, "olleh";
10-
is do {join ", ", reverse <ab cd ef>}, "ef, cd, ab";
9+
is do {flip "hello"}, "olleh", 'string reversal';
10+
is do {join ", ", reverse <ab cd ef>}, "ef, cd, ab", 'list reversal';
1111

1212
my %capitals = France => "Paris", UK => "London";
13-
is_deeply %capitals.invert, ("Paris" => "France", "London" => "UK").list.item;
13+
is_deeply %capitals.invert, ("Paris" => "France", "London" => "UK").list.item, 'hash inversion';
1414

1515
my %original := %capitals;
1616
my %inverse;
1717
%inverse.push( %original.invert );
1818

19-
is_deeply %inverse, {"Paris" => "France", "London" => "UK"};
19+
is_deeply %inverse, {"Paris" => "France", "London" => "UK"}, 'hash inversion, non-distructive';
2020

2121
my %h;
22-
%h.push('foo' => 1); is_deeply %h, {foo => 1};
23-
%h.push('foo' => 2); is_deeply %h, {foo => [1, 2]};
24-
%h.push('foo' => 3); is_deeply %h, {foo => [1, 2, 3]};
22+
23+
%h.push('foo' => 1);
24+
is_deeply %h, {foo => 1}, 'hash element push';
25+
26+
%h.push('foo' => 2);
27+
is_deeply %h, {foo => [1, 2]}, 'hash element push';
28+
29+
%h.push('foo' => 3);
30+
is_deeply %h, {foo => [1, 2, 3]}, 'hash element push';
31+
32+
is_deeply flip(<a b c>.list), "c b a", 'flip coercement (list)';

0 commit comments

Comments
 (0)