Skip to content

todo test for GH 18669 (dereferencing ternary skips autovivification) #23534

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

Merged
merged 1 commit into from
Aug 4, 2025

Conversation

1-1sam
Copy link
Contributor

@1-1sam 1-1sam commented Aug 3, 2025

This PR adds a todo test for #18669, which still appears to be broken.

Copy link

@Imran-imtiaz48 Imran-imtiaz48 left a comment

Choose a reason for hiding this comment

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

The code in this test script is well-structured for verifying Perl's autovivification behavior with hash and array references. It correctly checks whether pushing to a non-existent hash entry (using a ternary to conditionally assign an array reference) leads to automatic creation of the necessary data structure. The test case with print $x->{ new }[0]; confirms that Perl handles this as expected by producing the value 'mana', and the use of is($?, 0, ...) ensures there’s no runtime error or assertion failure. In the second snippet, the test initializes a hash with an explicit undef value for the arr key, likely preparing for further exploration of edge cases around autovivification. Overall, the code is clean, adheres to testing best practices using Test::More, and provides meaningful checks to validate Perl’s internal behaviors around reference handling. This makes it a valuable contribution to a test suite focused on Perl’s reference semantics.

@khwilliamson
Copy link
Contributor

@1-1sam the second commit needs to be squashed into the first one, so that this is a single commit

@khwilliamson khwilliamson merged commit 5d79c38 into Perl:blead Aug 4, 2025
33 checks passed
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.

4 participants