diff --git a/S06-currying/assuming-and-mmd.t b/S06-currying/assuming-and-mmd.t index ab41c11e6f..e876abdc3f 100644 --- a/S06-currying/assuming-and-mmd.t +++ b/S06-currying/assuming-and-mmd.t @@ -1,8 +1,11 @@ use v6; +use lib 't/spec/packages'; + use Test; +use Test::Assuming; -plan 7; +plan 11; # RT #77520 & RT #125155 @@ -24,4 +27,13 @@ is &testsub(23, 42), "Int", "basic MMD works with subrefs (2)"; is &testsub.assuming("a_str")(42), "Str", "basic MMD works with assuming (1)"; is &testsub.assuming(23)\ .(42), "Int", "basic MMD works with assuming (2)"; +# RT #126332 +multi rt126332 ($x) { 'a' } +multi rt126332 ($x, $y) { 'b' } +multi rt126332 ($x, $y, $z) { 'c' } +is-primed-call(&rt126332, \(1), $[&rt126332(1)]); +is-primed-call(&rt126332, \(2), $[&rt126332(1,2)], 1); +is-primed-call(&rt126332, \(2,3), $[&rt126332(1,2,3)], 1); +throws-like({EVAL '&rt126332.assuming(1)(2,3,4)'; CATCH { }}, X::Multi::NoMatch); + # vim: ft=perl6 diff --git a/S06-currying/positional.t b/S06-currying/positional.t index 079c6d919c..edeb97dddf 100644 --- a/S06-currying/positional.t +++ b/S06-currying/positional.t @@ -5,7 +5,7 @@ use lib 't/spec/packages'; use Test; use Test::Assuming; -plan 227; +plan 229; is-primed-sig(sub () { }, :(), ); is-primed-sig(sub ($a) { }, :(), 1); @@ -253,3 +253,8 @@ is-primed-call(&testsubproto, \(43), $["Int + 43"], 42); is-primed-call(&testsubproto, \(44), $["Str + 44"], "a Str"); is-primed-call(&atan2, \(2), $[atan2(1,2)],1); is-primed-call(&atan2, \(1), $[atan2(1,2)],*,2); + +# RT#126332 +is-primed-call(&substr, \(0,2), $[substr("hello world", 0, 2)], "hello world"); +is-primed-call(sub (*@x) { @x.perl }, \("c","d","e"), $[sub (*@x) { @x.perl }("a","b","c","d","e")], "a", "b"); +