Skip to content

Commit

Permalink
Use more correct approach in list EVAL roundtrip
Browse files Browse the repository at this point in the history
The previous version of the test expected the same container to be
preserved for an itemized list despite roundtripping it through EVAL.
But this is incorrect because:

- we itemize two different lists despite both being empty
- why would method `item` always return same scalar container, whatever
  it wouldd mean in terms of comparing two containers
- and then we expect `EVAL` method to somehow preserve that container
  despite the string recevied from `raku` method does not provide us
  with any hints about the container details

So, the only correct approach for this test is to make sure that both
lists: directly itemized and roundtripped one, - are contained by the
same type of container.

In support of Raku/problem-solving#291
  • Loading branch information
vrurg authored and Altai-man committed Aug 21, 2021
1 parent ddfa7cf commit 3bc28f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion S02-types/list.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ is ().perl, '()', '.perl on empty List';
is ().item.perl, '$( )', '.item.perl on empty List';
is-deeply ().item, ().item.perl.EVAL, 'can roundtrip ().item';
#?rakudo.jvm skip 'dies with t/harness5'
cmp-ok ().item.VAR, '===', ().item.perl.EVAL.VAR,
cmp-ok ().item.VAR.WHAT, '===', ().item.perl.EVAL.VAR.WHAT,
'().item .perl.EVAL roundtrip preserves itemization';

# L<S02/Quoting forms/Elsewhere it is equivalent to a parenthesized list of strings>
Expand Down

0 comments on commit 3bc28f4

Please sign in to comment.