Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
test for RT #76834
  • Loading branch information
moritz committed Oct 3, 2011
1 parent b518730 commit 439f6e0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions S12-subset/subtypes.t
Expand Up @@ -231,6 +231,12 @@ ok "x" !~~ NW1, 'subset declaration without where clause rejects wrong value';
subset Many::Parts of Str;
ok 'a' ~~ Many::Parts, 'subset names with many parts work';
}

{
subset Int::Positive of Int where { $_ > 0 };
sub f(Int::Positive $a) { $a * $a };
nok eval('f(-2)'), 'Cannot violate Int::Positive constraint';
}
done;

# vim: ft=perl6

0 comments on commit 439f6e0

Please sign in to comment.