Skip to content

Commit

Permalink
[t/spec] simple multi dispatch tests for sigil-implied type constraints
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.pugscode.org/pugs@24954 c213334d-75ef-0310-aa23-eaa082d1ae64
  • Loading branch information
moritz committed Jan 19, 2009
1 parent ca224d0 commit 3088a5a
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion S06-multi/type-based.t
@@ -1,6 +1,6 @@
use v6;
use Test;
plan 18;
plan 22;

# type based dispatching
#
Expand Down Expand Up @@ -67,3 +67,16 @@ is(mmd(), 1, 'Slurpy MMD to nullary');
is(mmd(1,2,3), 2, 'Slurpy MMD to listop via args');
is(mmd(1..3), 2, 'Slurpy MMD to listop via list');

#?rakudo skip 'Dispatch on sigil-implied type constraints'
{
my %h = (:a<b>, :c<d>);
multi sub sigil-t (&code) { 'Callable' }
multi sub sigil-t ($any) { 'Any' }
multi sub sigil-t (@ary) { 'Positional' }
multi sub sigil-t (%h) { 'Associative' }
is sigil-t(1), 'Any', 'Sigil-based dispatch (Any)';
is sigil-t({ $_ }), 'Callable', 'Sigil-based dispatch (Callable)';
is sigil-t(<a b c>), 'Positional','Sigil-based dispatch (Arrays)';
is sigil-t(%h), 'Associative','Sigil-based dispatch (Associative)';

}

0 comments on commit 3088a5a

Please sign in to comment.