Skip to content

Commit

Permalink
Test using fail in subset for custom message (Raku#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
zostay authored and zoffixznet committed Oct 20, 2016
1 parent 381cf28 commit f06324c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion S12-subset/subtypes.t
Expand Up @@ -4,7 +4,7 @@ use lib 't/spec/packages';

use Test;

plan 85;
plan 86;

use Test::Util;

Expand Down Expand Up @@ -104,6 +104,14 @@ Tests subtypes, specifically in the context of multimethod dispatch.
dies-ok { my Num::Multiple $e = 10 }, "changed subtype definition worked";
}

# Subsets with custom error messages
{
my subset Even of Int where { $^num %% 2 or fail "$num is not even" };
throws-like {
my Even $e = 1;
}, Exception, :message("1 is not even");
}

# Rakudo had a bug where 'where /regex/' failed
# RT #60976
#?DOES 2
Expand Down

0 comments on commit f06324c

Please sign in to comment.