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

test: Fix failing inot test #1841

Merged
merged 2 commits into from
Jan 7, 2025
Merged

test: Fix failing inot test #1841

merged 2 commits into from
Jan 7, 2025

Conversation

croyzor
Copy link
Contributor

@croyzor croyzor commented Jan 7, 2025

The !1 = 0 test doesn't work because the ints it's run on are more than 1 bit wide. I tried reducing the width but it seems the hugr-llvm conversion isn't faithful, downcasting smaller int types to u8, meaning !1 would be 254

@croyzor croyzor requested a review from ss2165 January 7, 2025 09:19
@croyzor croyzor requested a review from a team as a code owner January 7, 2025 09:19
@@ -463,7 +463,7 @@ mod test {
#[rstest]
// LHS: Most significant bit (2^63), RHS: All the other bits combined
#[case::inot("inot", 9223372036854775808, 9223372036854775807)]
#[case::inot("inot", 1, 0)]
#[case::inot("inot", 18446744073709551615, 0)]
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
#[case::inot("inot", 18446744073709551615, 0)]
#[case::inot("inot", !0u64, 0)]

All I'm after is something easy to verify by eye really

Copy link
Contributor Author

Choose a reason for hiding this comment

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

😮

@croyzor croyzor changed the title tests: Fix failing inot test test: Fix failing inot test Jan 7, 2025
@croyzor croyzor added this pull request to the merge queue Jan 7, 2025
Merged via the queue into main with commit 09cbc6a Jan 7, 2025
19 of 20 checks passed
@croyzor croyzor deleted the tests/fix-not branch January 7, 2025 10:30
@hugrbot hugrbot mentioned this pull request Jan 7, 2025
@hugrbot hugrbot mentioned this pull request Jan 16, 2025
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.

2 participants