This is an automatically generated mail to inform you that tests are now available in t/spec/S06-multi/type-based.t
commit 0235444cbd338b0823a093899816fb4105fedb4e Author: bbkr <b...@c213334d-75ef-0310-aa23-eaa082d1ae64> Date: Mon Jun 28 17:04:34 2010 +0000 [t/spec/S06-multi/type-based.t] tests for RT #72750 Make Inf and NaN acceptable constants parameters in Rakudo git-svn-id: http://svn.pugscode.org/p...@31483 c213334d-75ef-0310-aa23-eaa082d1ae64 diff --git a/t/spec/S06-multi/type-based.t b/t/spec/S06-multi/type-based.t index 37cb2db..a218b14 100644 --- a/t/spec/S06-multi/type-based.t +++ b/t/spec/S06-multi/type-based.t @@ -7,6 +7,7 @@ plan *; #L<S06/"Longname parameters"> #L<S12/"Multisubs and Multimethods"> +multi foo (5) { "Constant" } multi foo (Int $bar) { "Int " ~ $bar } multi foo (Str $bar) { "Str " ~ $bar } multi foo (Rat $bar) { "Rat " ~ $bar } @@ -16,9 +17,13 @@ multi foo (Sub $bar) { "Sub " ~ $bar() } multi foo (@bar) { "Positional " ~ join(', ', @bar) } multi foo (%bar) { "Associative " ~ join(', ', %bar.keys.sort) } multi foo (IO $fh) { "IO" } +multi foo (Inf) { "Inf" } +multi foo (NaN) { "NaN" } + +is foo(5), 'Constant', 'dispatched to the constant sub'; -is(foo('test'), 'Str test', 'dispatched to the Str sub'); is(foo(2), 'Int 2', 'dispatched to the Int sub'); +is(foo('test'), 'Str test', 'dispatched to the Str sub'); my $num = '4'; is(foo(1.4), 'Rat 1.4', 'dispatched to the Num sub'); @@ -34,6 +39,9 @@ is(foo(%hash), 'Associative bar, baz, foo', 'dispatched to the Associative sub') is(foo($*ERR), 'IO', 'dispatched to the IO sub'); +is foo(Inf), 'Inf', 'dispatched to the Inf sub'; +is foo(NaN), 'NaN', 'dispatched to the NaN sub'; + # You're allowed to omit the "sub" when declaring a multi sub. # L<S06/"Routine modifiers">