Skip to content

Instantly share code, notes, and snippets.

@Whateverable
Created September 16, 2017 18:58
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save Whateverable/00b35084df73b2cc62099b1abf326612 to your computer and use it in GitHub Desktop.
evalable6
use Test; class Bar { method bar { die "a b c"; } }; throws-like { Bar.new().bar }, Exception, "test3", message => m:s/a b/;
(exit code 1)
Use of uninitialized value of type Any in string context.
Methods .^name, .perl, .gist, or .say can be used to stringify it to something meaningful.
1..3
ok 1 - code dies
ok 2 - right exception type (Exception)
not ok 3 - .message matches Nil
not ok 1 - test3
in block <unit> at /tmp/_6MYUjieEZ line 1
# Failed test '.message matches Nil'
# at SETTING::src/core/Any-iterable-methods.pm line 618
# Expected: Nil
# Got: a b c
# Looks like you failed 1 test of 3
# Failed test 'test3'
# at /tmp/_6MYUjieEZ line 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment