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

tests: Adjust conformance tests to account for array invariant #1289

Merged
merged 1 commit into from
Jun 7, 2024

Conversation

zeux
Copy link
Collaborator

@zeux zeux commented Jun 7, 2024

These were written before compiler optimizations and array invariant. It is now impossible for t[1] to be stored in the hash part, as this would violate the array invariant that says that elements 1..#t are stored in the array.

For ipairs, it doesn't traverse the hash part anymore now, so we adjust the code to make sure no elements outside of the 1..#t slice are covered. For table.find, we can use find-with-offset to still access the hash part.

Fixes #1283.

These were written before compiler optimizations and array invariant. It
is now impossible for t[1] to be stored in the hash part, as this would
violate the array invariant that says that elements 1..#t are stored in
the array.

For ipairs, it doesn't traverse the hash part anymore now, so we adjust
the code to make sure no elements outside of the 1..#t slice are
covered. For table.find, we can use find-with-offset to still access the
hash part.
@vegorov-rbx vegorov-rbx merged commit 81b2cc7 into master Jun 7, 2024
8 checks passed
@vegorov-rbx vegorov-rbx deleted the tests-tableinv branch June 7, 2024 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

Test doesn't do what it says it does
2 participants