Skip to content

Commit cb96abf

Browse files
committed
[v6.d REVIEW] Simplify consumed Seq .perl.EVAL
- Use fewer things - Use more precise tests
1 parent 1a4548d commit cb96abf

File tree

1 file changed

+4
-9
lines changed

1 file changed

+4
-9
lines changed

S32-list/seq.t

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -114,15 +114,10 @@ is-deeply @searches[0].Array, @expected-searches, 'seq => array works 3';
114114

115115
{
116116
# RT #127492;
117-
use MONKEY-SEE-NO-EVAL;
118-
my \s = ().Seq;
119-
# consume the seq
120-
my @dummy = s.list;
121-
my \roundtripped = EVAL s.perl;
122-
ok roundtripped.defined, '.perl on an iterated sequence works';
123-
124-
throws-like { roundtripped.list }, X::Seq::Consumed,
125-
'.perl on an iterated sequence faithfully reproduces such a sequence';
117+
eager my \s = ().Seq; # eager consumes the Seq
118+
cmp-ok s.perl.EVAL, '~~', Seq:D, '.perl.EVAL on consumed Seq gives Seq:D';
119+
throws-like { s.perl.EVAL.list }, X::Seq::Consumed,
120+
'.perl.EVAL-roundtripped Seq throws when attempting to consume again';
126121
}
127122

128123
{

0 commit comments

Comments
 (0)