Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lives-ok and throws-ok both fail for the same code #2766

Open
Leont opened this issue Mar 15, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@Leont
Copy link
Contributor

commented Mar 15, 2019

The Problem

Both of these fail:

use Test;
my @foo = Failure.new(""), Failure.new("");
throws-like { @foo[0] }, Exception, "Does throw";
lives-ok { @foo[1] }, "Does throw";

Expected Behavior

One of these to fail and the other succeed. I'm not entirely sure which behavior is desirable, but I'm pretty sure consistency is.

Actual Behavior

Both fail.

Environment

This is Rakudo version 2019.03 built on MoarVM version 2019.03
implementing Perl 6.d.
@Leont

This comment has been minimized.

Copy link
Contributor Author

commented Mar 17, 2019

BTW, lives-ok behaves this way because it calls it's argument from within a try block, and the try block enables «use fatal».

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.