diff --git a/S12-subset/subtypes.t b/S12-subset/subtypes.t index b3a2a13592..030d2e1569 100644 --- a/S12-subset/subtypes.t +++ b/S12-subset/subtypes.t @@ -4,7 +4,7 @@ use lib 't/spec/packages'; use Test; -plan 85; +plan 86; use Test::Util; @@ -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