Skip to content
This repository was archived by the owner on Feb 3, 2021. It is now read-only.

Commit 2613f07

Browse files
committed
Add test for RPA.map
1 parent e657b28 commit 2613f07

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

t/setting/01-resizablepmcarray.t

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ pir::load_bytecode('nqp-setting.pbc');
55
my @array := <0 1 2>;
66
my @reversed := @array.reverse();
77

8-
plan(11);
8+
plan(13);
99

1010
ok( @reversed[0] == 2, 'First element correct');
1111
ok( @reversed[1] == 1, 'Second element correct');
@@ -26,4 +26,9 @@ ok( @test[1] eq 'cherry', '@test[1] was deleted');
2626
ok( +@test == 2, '@test[1] has two items');
2727
ok( !@test.exists(2), '@test[2] no longer exists');
2828

29+
@test := <1 2 3>;
30+
my @res := @test.map(sub($a) { $a~$a; });
31+
ok( +@res == 3, 'Map produced same number of elements');
32+
ok( @res.join() eq '112233', 'Map produced correct elements');
33+
2934
# vim: ft=perl6

0 commit comments

Comments
 (0)