Skip to content

Commit

Permalink
Add Nil tests for $/, $!, $_
Browse files Browse the repository at this point in the history
  • Loading branch information
lizmat committed Aug 13, 2013
1 parent 751bd56 commit 7252f0d
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion S02-types/nil.t
Expand Up @@ -3,7 +3,7 @@ use Test;

# Nil may be a type now. Required?

plan 29;
plan 35;

sub empty_sub {}
sub empty_do { do {} }
Expand Down Expand Up @@ -90,6 +90,18 @@ ok !Nil.new.defined, 'Nil.new is not defined';
ok f4(Nil) === Nil, 'can use Nil as a default (nil-triggered)';
}

#?pugs todo '$/!_ does not default to Nil'
#?niecza todo '$/!_ does not default to Nil'
{
ok $/ === Nil, '$/ is by default Nil';
ok $! === Nil, '$! is by default Nil';
ok $_ === Nil, '$_ is by default Nil';

ok $/.VAR.default === Nil, '$/ has Nil as default';
ok $!.VAR.default === Nil, '$! has Nil as default';
ok $_.VAR.default === Nil, '$_ has Nil as default';
}

done;

# vim: ft=perl6

0 comments on commit 7252f0d

Please sign in to comment.