Skip to content

Commit

Permalink
Correct Nil tests
Browse files Browse the repository at this point in the history
Don't use `==` for testing for a `Nil`. Correcting these tests
shows Nil.ACCEPTS(Any) returns False in rakudo, so fudge that test.

I don't really see the point of making this special behaviour for
ACCEPTS. IIRC only regexes return something other then True/False.
  • Loading branch information
zoffixznet committed Oct 24, 2018
1 parent 58ac266 commit ac1ad09
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions S02-types/nil.t
Expand Up @@ -25,8 +25,9 @@ nok (my $x = Nil).defined, 'assigning Nil to scalar leaves it undefined'; #OK
ok (my $y = ()).defined, 'assigning () to scalar results in a defined list'; #OK

nok Nil.so, 'Nil.so is False';
ok Nil.ACCEPTS(Any) == Nil, 'Nil.ACCEPTS always returns Nil';
ok Nil.JustAnyMethod == Nil, 'Any method on Nil should return Nil';
#?rakudo todo 'returns False; is returning Nil really a good idea?'
ok Nil.ACCEPTS(Any) === Nil, 'Nil.ACCEPTS always returns Nil';
ok Nil.JustAnyMethod === Nil, 'Any method on Nil should return Nil';

# RT #63894
{
Expand Down

0 comments on commit ac1ad09

Please sign in to comment.