Skip to content

Commit

Permalink
my Num List sub should allow return of empty list RT #65128
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.pugscode.org/pugs@26500 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information
ron committed Apr 27, 2009
1 parent e70591f commit cd128b1
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion S06-routine-modifiers/scoped-named-subs.t
@@ -1,6 +1,6 @@
use v6;
use Test;
plan 8;
plan 12;

# L<S06/Named subroutines>

Expand Down Expand Up @@ -33,3 +33,20 @@ is ourNamedStr(), 'string', 'Correct : package-scoped named sub ourNamedStr() sh
}
is ourNamedInt(), 55, 'Correct : package-scoped named sub ourNamedInt() should BE available in the whole package';

eval_dies_ok
'my Num List sub f () { return ("A") }; f()',
'Return of list with wrong type dies';

#?rakudo todo 'RT 65128'
#?DOES 3
{
eval_lives_ok
'my Num List sub f () { return () }; f()',
'return of empty list should live';
is eval('my Num List sub f () { return () }; (f(), "a")'), ['a'],
'return of empty list should be empty list';

eval_dies_ok
'my Num List sub f () { ("A") }; f()',
'implicit return of list with wrong type dies';
}

0 comments on commit cd128b1

Please sign in to comment.