Skip to content

Instantly share code, notes, and snippets.

@zoffixznet
Created April 17, 2017 14:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zoffixznet/3b2815e55e908ca5427e8a03094c9159 to your computer and use it in GitHub Desktop.
Save zoffixznet/3b2815e55e908ca5427e8a03094c9159 to your computer and use it in GitHub Desktop.
cpan@perlbuild2/tmp/tmp.GG2xRiRTXH (master)$ prove -vlr --exec ./nqp-j t/nqp/044-try-catch.t
t/nqp/044-try-catch.t ..
1..54
ok 1 - nqp::getmessage
ok 2 - exceptions exit a try block
ok 3 - control exceptions are not caught by a try block
ok 4 - statement prefix form works when not throwing an exception
ok 5 - statement prefix form of try works
ok 6 - CATCH blocks are invoked when an exception occurs
ok 7 - CATCH blocks ignore control exceptions
ok 8 - rethrow and multiple exception handlers work
ok 9 - resuming from resumable exceptions works
ok 10 - combination of both try and CATCH
ok 11 - nqp::die_s
ok 12 - nqp::setmessage/nqp::getmessage
ok 13 - nqp::setpayload/nqp::getpayload
ok 14 - payload is null when not set
ok 15 - correct return value for nqp::setmessage
ok 16 - correct return value for nqp::setpayload
ok 17 - calling method on custom exception
ok 18 - nqp::setmessage/nqp::getmessage on custom exception
ok 19 - nqp::setpayload/nqp::getpayload on custom exception
ok 20 - rethrow works from a scope higher then CATCH
ok 21 - rethrow works from a scope that is not a direct ancestor
ok 22 - exception is true
ok 23 - returning values from try works
ok 24 - variable does get overwriten by bug
ok 25 - can get a native int result of a try block that catches an exception
ok 26 - can get a native str result of a try block that catches an exception
ok 27 - we get correct return value from a try that catches a missing method
ok 28 - we get correct return value from a try that catches a missing method used as int
ok 29 - we get correct return value from a try that catches a missing method used as num
ok 30 - we get correct return value from a try that catches a missing method used as str
ok 31 - nqp::setmessage/nqp::getmessage with calling nqp::handle directly
ok 32 - nqp::setpayload/nqp::getpayload with calling nqp::handle directly
ok 33 - caught NEXT exception
ok 34 - caught REDO exception
ok 35 - caught LAST exception
ok 36 - caught RETURN exception
ok 37 - caught TAKE exception
ok 38 - caught WARN exception
ok 39 - caught SUCCEED exception
ok 40 - caught PROCEED exception
ok 41 - caught EMIT exception
ok 42 - caught DONE exception
ok 43 - CONTROL block works
ok 44 - CONTROL block works with WARN
ok 45 - nqp::getextype gets the correct type
ok 46 - CONTROL not caught
ok 47 - CATCH caught the lowlevel error
ok 48 - throwextype works
ok 49 - nqp::resume exits from the nqp::handle block
ok 50 - nqp::resume works with a CONTROL block
ok 51 - catching labeled exception - outer handle
ok 52 - catching labeled exception - inner handle
ok 53 - a nqp::handle with label catches unlabeled exception
Unhandled exception; category = 4224
in <anon> (gen/jvm/stage2/NQPHLL.nqp:1281)
in <anon> (gen/jvm/stage2/NQPHLL.nqp)
in catch_unlabeled_first (t/nqp/044-try-catch.t:428)
in <mainline> (t/nqp/044-try-catch.t:439)
in eval (gen/jvm/stage2/NQPHLL.nqp:1168)
in evalfiles (gen/jvm/stage2/NQPHLL.nqp:1371)
in command_eval (gen/jvm/stage2/NQPHLL.nqp:1265)
in command_line (gen/jvm/stage2/NQPHLL.nqp:1239)
in MAIN (gen/jvm/stage2/NQP.nqp:4130)
in <mainline> (gen/jvm/stage2/NQP.nqp:4126)
in <anon> (gen/jvm/stage2/NQP.nqp)
Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/54 subtests
Test Summary Report
-------------------
t/nqp/044-try-catch.t (Wstat: 256 Tests: 53 Failed: 0)
Non-zero exit status: 1
Parse errors: Bad plan. You planned 54 tests but ran 53.
Files=1, Tests=53, 3 wallclock secs ( 0.02 usr 0.01 sys + 14.81 cusr 0.52 csys = 15.36 CPU)
Result: FAIL
cpan@perlbuild2/tmp/tmp.GG2xRiRTXH (master)$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment