Skip to content

Commit

Permalink
Add tests for RT #131414
Browse files Browse the repository at this point in the history
  • Loading branch information
usev6 committed May 10, 2018
1 parent f09951c commit 7fcc804
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion S12-coercion/coercion-types.t
Expand Up @@ -3,7 +3,7 @@ use lib $?FILE.IO.parent(2).add("packages");
use Test;
use Test::Util;

plan 32;
plan 33;

# coercion types in parameter lists
{
Expand Down Expand Up @@ -322,4 +322,13 @@ subtest 'mistyped typenames in coercers give good error' => {
pass 'coercer with subset target did not crash';
}

# RT #131414
subtest 'same exception with and without type smiley for failing coercion on var' => {
plan 3;
my \XSVB = X::Syntax::Variable::BadType;
throws-like class { has Int() $.x = "42"}.new.x, XSVB, 'no type smiley';
throws-like class { has Int:D() $.x = "42"}.new.x, XSVB, ':D (1)';
throws-like class { has Int:D() $.x = "42"}.new(:x("43")), XSVB, ':D (2)';
}

# vim: ft=perl6

0 comments on commit 7fcc804

Please sign in to comment.