Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
test negative parameter values
  • Loading branch information
TimToady committed Sep 19, 2015
1 parent d375959 commit 08154ac
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion S06-multi/value-based.t
Expand Up @@ -2,7 +2,7 @@ use v6;

use Test;

plan 12;
plan 13;

# L<S06/Routine modifiers/>
# L<S06/Parameters and arguments/>
Expand All @@ -25,11 +25,13 @@ plan 12;
multi m2(2) { "b" }
multi m2(Int $x) { "c" } #OK not used
multi m2($x) { "d" } #OK not used
multi m2(-1) { "e" }

is m2(1), "a", 'literal Int in signature matches value correctly';
is m2(2), "b", 'literal Int in signature matches value correctly';
is m2(3), "c", 'fallback to Int variant which is less narrow than constrained one';
is m2("x"), "d", 'if not an Int at all, fall back to Any candidate';
is m2(-1), "e", 'negative literal Int in signature matches value correctly';
}

# RT #88562
Expand Down

0 comments on commit 08154ac

Please sign in to comment.