Permalink
Browse files

Test instantiating non-class has its name in error

For RT #122232
  • Loading branch information...
MasterDuke17 committed May 10, 2017
1 parent 2df7060 commit 4666505570d0eba84273617b577ad59f0d887acf
Showing with 12 additions and 0 deletions.
  1. +12 −0 t/05-messages/01-errors.t
View
@@ -113,6 +113,18 @@ for <fail die throw rethrow resume> -> $meth {
'sinking to a code object in a feed suggests calling the routine';
}
# RT #122232
{
throws-like { class A::B {}; A.new },
Exception,
message => /<<'A'>>/,
'trying to instantiate a non-class gives the name in the error';
throws-like { subset Foo of Int where * > 42; Foo.new },
Exception,
message => /<<'Foo'>>/,
'trying to instantiate a non-class gives the name in the error';
}
done-testing;
# vim: ft=perl6 expandtab sw=4

0 comments on commit 4666505

Please sign in to comment.