Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
account for list listop passing Seq through
  • Loading branch information
TimToady committed Sep 20, 2015
1 parent 9079e5d commit 5463a12
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions S03-operators/context-forcers.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 103;
plan 106;

#?DOES 1
sub iis(Mu $a, Mu $b, $descr) {
Expand Down Expand Up @@ -238,12 +238,20 @@ sub eval_elsewhere($code){ EVAL($code) }

{
my $l = list 1,2,4...16;
ok $l.WHAT === List, "list listop produces List";
ok $l.WHAT === Seq, "list listop on Seq is no-op";
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 = list 1..5;
ok $l.WHAT === List, "list listop on non-Seq is List";
ok $l.gist eq '(1 2 3 4 5)', "list listop doesn't double wrap";
my \seq = $l.grep(* > 0);
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";
Expand Down

0 comments on commit 5463a12

Please sign in to comment.