Created
November 9, 2016 19:05
-
-
Save ajs/c11a00290b52957a5f686c8ad3c60885 to your computer and use it in GitHub Desktop.
Test program that shows classes that do not call their BUILD when subclassed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ perl6 -e 'role Thrower { submethod BUILD(|c) { die; } }; use Test; for <Any Hash Set Int List Routine Mu> -> $name { my $type = ::($name); my $thing = $type.^mixin(Thrower); dies-ok {$thing.new }, "Expect BUILD on ({$thing.perl})" }' | |
ok 1 - Expect BUILD on (Any+{Thrower}) | |
not ok 2 - Expect BUILD on (Hash+{Thrower}) | |
# Failed test 'Expect BUILD on (Hash+{Thrower})' | |
# at -e line 1 | |
not ok 3 - Expect BUILD on (Set+{Thrower}) | |
# Failed test 'Expect BUILD on (Set+{Thrower})' | |
# at -e line 1 | |
ok 4 - Expect BUILD on (Int+{Thrower}) | |
not ok 5 - Expect BUILD on (List+{Thrower}) | |
# Failed test 'Expect BUILD on (List+{Thrower})' | |
# at -e line 1 | |
ok 6 - Expect BUILD on (Routine+{Thrower}) | |
ok 7 - Expect BUILD on (Mu+{Thrower}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment