Skip to content

Commit

Permalink
Add tests for RT #123700
Browse files Browse the repository at this point in the history
  • Loading branch information
usev6 committed Oct 23, 2015
1 parent cd4b6ba commit 6082102
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion S12-subset/subtypes.t
Expand Up @@ -2,7 +2,10 @@ use v6;

use Test;

plan 77;
plan 79;

use lib 't/spec/packages';
use Test::Util;

=begin description
Expand Down Expand Up @@ -285,4 +288,26 @@ ok "x" !~~ NW1, 'subset declaration without where clause rejects wrong value';
isa-ok $!, X::Undeclared, 'subset in signature cannot use non-predeclared variable';
}

# RT #123700
{
throws-like q[
subset Tiny of Any where ^3;
my Tiny $foo;
$foo = 42; say $foo;
],
X::TypeCheck, 'code dies with right exception';

is_run q[
subset Tiny of Any where {say $_; $_ ~~ ^3};
my Tiny $foo;
$foo = 0; say $foo;
],
{
status => 0,
out => rx/^ 0 \n 0 \n $/,
err => '',
},
'code runs without error (and does not mention "Obsolete"!)';
}

# vim: ft=perl6

0 comments on commit 6082102

Please sign in to comment.