Skip to content

Commit

Permalink
[t/spec] test that the return value from .grep Boolifies sensibly (RT…
Browse files Browse the repository at this point in the history
… #74056)

git-svn-id: http://svn.pugscode.org/pugs@30313 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information
moritz committed Apr 5, 2010
1 parent 0949096 commit 861910a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions S32-list/grep.t
Expand Up @@ -126,6 +126,16 @@ my @list = (1 .. 10);

}

# seensible boolification
# RT #74056
# since rakudo returns an iterator (and not a list) and some internals leaked,
# a zero item list/iterator would return True, which is obviously wrong
{
ok <0 1 2>.grep(1), 'Non-empty return value from grep is true (1)';
ok <0 1 2>.grep(0), 'Non-empty return value from grep is true (2)';
nok <0 1 2>.grep(3), 'Empty return value from grep is false';
}

done_testing;

# vim: ft=perl6

0 comments on commit 861910a

Please sign in to comment.