Skip to content

Commit

Permalink
test new list/cache listops
Browse files Browse the repository at this point in the history
  • Loading branch information
TimToady committed Sep 12, 2015
1 parent 3a5cb6d commit a046d74
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion S03-operators/context-forcers.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 97;
plan 103;

#?DOES 1
sub iis(Mu $a, Mu $b, $descr) {
Expand Down Expand Up @@ -236,4 +236,20 @@ sub eval_elsewhere($code){ EVAL($code) }
isa-ok ^@a, Range;
}

{
my $l = list 1,2,4...16;
ok $l.WHAT === List, "list listop produces List";
ok $l.gist eq '(1 2 4 8 16)', "list listop doesn't double wrap";
my \seq = 1,2,4...16;
dies-ok { sink (list seq)».abs, (list seq)».abs }, "list listop doesn't cache";
}

{
my $l = cache 1,2,4...16;
ok $l.WHAT === List, "cache listop produces List";
ok $l.gist eq '(1 2 4 8 16)', "cache listop doesn't double wrap";
my \seq = 1,2,4...16;
is ((cache seq)».abs, (cache seq)».abs).gist, '((1 2 4 8 16) (1 2 4 8 16))', "cache listop does cache";
}

# vim: ft=perl6

0 comments on commit a046d74

Please sign in to comment.