Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add test for RT #113680
  • Loading branch information
usev6 committed Sep 30, 2014
1 parent f8e0c0d commit afc4d1e
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion S32-exceptions/misc.t
@@ -1,7 +1,7 @@
use v6;
use Test;

plan 266;
plan 267;

#?DOES 1
throws_like { Buf.new().Str }, X::Buf::AsStr, method => 'Str';;
Expand Down Expand Up @@ -533,4 +533,10 @@ throws_like '&[doesntexist]', X::Comp, # XXX probably needs exception type fix
is $*foo, 0, 'should be a compile time error';
}

# RT #113680
{
throws_like { EVAL("use ThisDoesNotExistAtAll ") }, X::AdHoc,
message => "Could not find ThisDoesNotExistAtAll in any of: " ~ @*INC.join(", ");
}

# vim: ft=perl6

2 comments on commit afc4d1e

@moritz
Copy link
Contributor

@moritz moritz commented on afc4d1e Sep 30, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A nicer approach (but more work) would be to create a new exception type, for example X::NoSuchModule, and throw it in rakudo, and then test for that exception type.

If you want to do it that way, and want guidance, please ask me on the IRC channel.

@usev6
Copy link
Contributor Author

@usev6 usev6 commented on afc4d1e Jan 1, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FWIW, I didn't manage to use a typed exception for this problem. It's been a while since I tried, but IIRC my guess was that I had no access to typed exceptions in class Perl6::ModuleLoader.

Please sign in to comment.