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

Add a test ensuring a Hash iterator misuse is not exploding #731

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Altai-man
Copy link
Member

Closes rakudo/rakudo#1340 (aims to)

I am really not sure where the nqp integration tests should belong, but this appears like the most fitting place to me, please check those with wisdom.

}
}

ok($msg eq "", 'No SEGV on a misused hash iterator');
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not seeing $msg being changed? Is that just to create a valid ok test? If that was the intent, you can also say:

pass 'No SEGV on a misused hash iterator'

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, my bad as I did not add $msg = ... bit into CATCH, huh.
Also, given it is not directly an exception, but a SEGV is maybe a better option, let's see...

Copy link
Member Author

Choose a reason for hiding this comment

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

There is apparently no pass in nqp, so just corrected the bit.

Copy link
Contributor

Choose a reason for hiding this comment

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

Altai-man: It looks like the test actually checks for both no SEGV (by happening at all) and no exception (by leaving $msg unchanged). Might be worth changing the test description to match that.

@Altai-man Altai-man force-pushed the tests-for-iterator-misuse branch from a19e355 to 98f38a4 Compare July 6, 2021 15:02
@Altai-man
Copy link
Member Author

The test failures seem to be flappers. :(

@coke coke self-assigned this Oct 15, 2021
@coke coke changed the base branch from master to main April 19, 2023 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Short script 'misusing' an iterator crashes Rakudo
5 participants