Skip to content

Commit

Permalink
Add tests for RT#126332
Browse files Browse the repository at this point in the history
  • Loading branch information
skids committed Sep 12, 2017
1 parent 0948c61 commit cd4b226
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
14 changes: 13 additions & 1 deletion 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
Expand All @@ -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
7 changes: 6 additions & 1 deletion S06-currying/positional.t
Expand Up @@ -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);
Expand Down Expand Up @@ -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");

0 comments on commit cd4b226

Please sign in to comment.