Browse files

Fudge for niecza.

  • Loading branch information...
1 parent 1d6c88b commit 3beca23051ba704b71058438b9c8f1641f43b8af @colomon colomon committed Jan 8, 2012
Showing with 12 additions and 0 deletions.
  1. +12 −0 S06-multi/type-based.t
View
12 S06-multi/type-based.t
@@ -7,6 +7,7 @@ plan 51;
#L<S06/"Longname parameters">
#L<S12/"Multisubs and Multimethods">
+#?niecza emit # foo (5) NYI
multi foo (5) { "Constant" }
multi foo (Int $bar) { "Int " ~ $bar }
multi foo (Str $bar) { "Str " ~ $bar }
@@ -17,9 +18,12 @@ 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" } #OK not used
+#?niecza emit # foo (5) NYI
multi foo (Inf) { "Inf" }
+#?niecza emit # foo (5) NYI
multi foo (NaN) { "NaN" }
+#?niecza todo
is foo(5), 'Constant', 'dispatched to the constant sub';
is(foo(2), 'Int 2', 'dispatched to the Int sub');
@@ -37,8 +41,10 @@ is(foo(@array), 'Positional foo, bar, baz', 'dispatched to the Positional sub');
my %hash = ('foo' => 1, 'bar' => 2, 'baz' => 3);
is(foo(%hash), 'Associative bar, baz, foo', 'dispatched to the Associative sub');
+#?niecza skip '$*ERR is apparently not IO'
is(foo($*ERR), 'IO', 'dispatched to the IO sub');
+#?niecza 2 skip 'We turned these off because of a niecza bug'
is foo(Inf), 'Inf', 'dispatched to the Inf sub';
is foo(NaN), 'NaN', 'dispatched to the NaN sub';
@@ -60,6 +66,7 @@ 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');
+#?niecza skip 'two or more Anys error'
{
my %h = (:a<b>, :c<d>);
multi sub sigil-t (&code) { 'Callable' } #OK not used
@@ -73,6 +80,7 @@ is(mmd(1..3), 2, 'Slurpy MMD to listop via list');
}
+#?niecza skip 'GLOBAL::T does not name any package'
{
class Scissor { }
@@ -123,6 +131,7 @@ is(mmd(1..3), 2, 'Slurpy MMD to listop via list');
is f2(3), 1, 'arity-based dispatch to ($)';
is f2('foo', f2(3)), 2, 'arity-based dispatch to ($, $)';
is f2('foo', 4, 8), 3, 'arity-based dispatch to ($, $, $)';
+ #?niecza skip 'Ambiguous dispatch for &f2'
is f2('foo', 4, <a b>), '3+', 'arity-based dispatch to ($, $, @)';
}
@@ -134,6 +143,7 @@ is(mmd(1..3), 2, 'Slurpy MMD to listop via list');
}
# multi dispatch on typed containers
+#?niecza skip 'Ambiguous dispatch for &f4'
{
multi f4 (Int @a ) { 'Array of Int' } #OK not used
multi f4 (Str @a ) { 'Array of Str' } #OK not used
@@ -163,6 +173,7 @@ is(mmd(1..3), 2, 'Slurpy MMD to listop via list');
# in a class (was a Rakudo regression, RT #65674)
#?rakudo skip 'our sub in class'
+#?niecza skip 'Two definitions found for symbol ::GLOBAL::A::&a'
{
class A {
our multi sub a(Int $x) { 'Int ' ~ $x }
@@ -181,6 +192,7 @@ is(mmd(1..3), 2, 'Slurpy MMD to listop via list');
is x([1],[2,3,4]), 2, 'where-clause that uses multiple params (1)';
}
+#?niecza skip 'GLOBAL::T does not name any package'
{
multi y(::T $x, T $y) { 1 } #OK not used
multi y($x, $y) { 2 } #OK not used

0 comments on commit 3beca23

Please sign in to comment.