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

eval-dies-ok/eval-lives-ok EVAL code in the wrong context #5383

Closed
p6rt opened this issue Jun 16, 2016 · 3 comments
Closed

eval-dies-ok/eval-lives-ok EVAL code in the wrong context #5383

p6rt opened this issue Jun 16, 2016 · 3 comments
Labels

Comments

@p6rt
Copy link

p6rt commented Jun 16, 2016

Migrated from rt.perl.org#128417 (status was 'rejected')

Searchable as RT128417$

@p6rt
Copy link
Author

p6rt commented Jun 16, 2016

From @zoffixznet

The results of these tests should be reversed, the eval-dies-ok succeeding and eval-lives-ok failing​:

zoffix@​leliana​:/tmp/tmp.0dxxAHGdyB$ perl6 -e 'm​: use Test; sub say {die $^a}; eval-dies-ok "say 42"'
42
not ok 1 -

# Failed test at -e line 1
zoffix@​leliana​:/tmp/tmp.0dxxAHGdyB$ perl6 -e 'm​: use Test; sub say {die $^a}; eval-lives-ok "say 42"'
42
ok 1 -
zoffix@​leliana​:/tmp/tmp.0dxxAHGdyB$

The reason is the code is EVALED in the context of Test.pm6 and not the current code. Compare that to the current implementation of throws-like, which does use current context.

@p6rt
Copy link
Author

p6rt commented Jun 16, 2016

From @zoffixznet

As per conversation with jnthn++ (http://irclog.perlgeek.de/perl6-dev/2016-06-16#i_12678792) this is actually not a bug and throws-like is buggy (reliant on a... um... wobbly feature).

@p6rt p6rt closed this as completed Jun 16, 2016
@p6rt
Copy link
Author

p6rt commented Jun 16, 2016

@zoffixznet - Status changed from 'new' to 'rejected'

@p6rt p6rt added the Bug label Jan 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant