Skip to content

Commit

Permalink
also test that listop forms are flattening
Browse files Browse the repository at this point in the history
  • Loading branch information
TimToady committed Apr 27, 2015
1 parent 931a0de commit 44d4696
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion S03-junctions/misc.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 117;
plan 129;

=begin pod
Expand Down Expand Up @@ -428,6 +428,26 @@ ok (1|2).Str ~~ Str, 'Junction.Str returns a Str, not a Junction';
ok (0|1 == 0&1), 'test junction evaluation order';
ok (0&1 == 0|1), 'test junction evaluation order';

# test flattening of listop forms

ok any((1,2,3),(4,5,6)) == 4, 'any is flattening 1';
nok any((1,2,4),(4,5,6)) == 3, 'any is flattening 2';
is (any((1,2,3),(4,5,6)) == 3).gist, 'any(False, False, True, False, False, False)', 'any is flattening 3';

ok all((4,5,6),(4,5,6)) > 3, 'all is flattening 1';
nok all((1,2,3),(4,5,6)) == 3, 'all is flattening 2';
is (all((1,2,3),(4,5,6)) == 3).gist, 'all(False, False, True, False, False, False)', 'all is flattening 3';

ok one((4,5,6),(4,5,6,7)) == 7, 'one is flattening 1';
nok one((1,2,3),(4,5,6)) eq '1 2 3' , 'one is flattening 2';
is (one((1,2,3),(4,5,6)) == 3).gist, 'one(False, False, True, False, False, False)', 'one is flattening 3';

ok none((4,5,6),(4,5,6,7)) == 3, 'none is flattening 1';
nok none((1,2,3,4),(4,5,6,7)) == '3' , 'none is flattening 2';
is (none((1,2,3),(4,5,6)) == 3).gist, 'none(False, False, True, False, False, False)', 'none is flattening 3';

# test non-flattening of method forms

nok (<a b c>,(4,5,6)).any == 4, '.any is not flattening 1';
ok (<a b c>,(4,5,6)).any == 3, '.any is not flattening 2';
is ((<a b c>,(4,5,6)).any == 3).gist, 'any(True, True)', '.any is not flattening 3';
Expand Down

0 comments on commit 44d4696

Please sign in to comment.