Skip to content

Introduce completion test utils #3555

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 2 commits into from
Mar 11, 2020
Merged

Introduce completion test utils #3555

merged 2 commits into from
Mar 11, 2020

Conversation

matklad
Copy link
Member

@matklad matklad commented Mar 11, 2020

bors r+
🤖

bors bot added a commit that referenced this pull request Mar 11, 2020
3555: Introduce completion test utils r=matklad a=matklad



bors r+
🤖

Co-authored-by: Aleksey Kladov <[email protected]>
@bors
Copy link
Contributor

bors bot commented Mar 11, 2020

Build failed

@matklad
Copy link
Member Author

matklad commented Mar 11, 2020

bors r+

@bors
Copy link
Contributor

bors bot commented Mar 11, 2020

@bors bors bot merged commit 7b323b4 into rust-lang:master Mar 11, 2020
@matklad matklad deleted the test branch March 16, 2020 12:11
lnicola pushed a commit to lnicola/rust-analyzer that referenced this pull request Jun 18, 2025
…RalfJung

Enable Non-determinism of float operations in Miri and change std tests

Links to [rust-lang#4208](rust-lang/miri#4208) and [rust-lang#3555](rust-lang/miri#3555) in Miri.

Non-determinism of floating point operations was disabled in rust-lang/rust#137594 because it breaks the tests and doc-tests in core/coretests and std. This PR enables some of them.

This pr includes the following changes:

- Enables the float non-determinism but with a lower relative error of 4ULP instead of 16ULP
- These operations now have a fixed output based on the C23 standard, except the pow operations, this is tracked in [rust-lang#4286](rust-lang/miri#4286 (comment))
- Changes tests that made incorrect assumptions about the operations, not to make that assumption anymore (from `assert_eq!` to `assert_approx_eq!`.
- Changed the doctests of the stdlib of these operations to compare against fixed constants instead of `f*::EPSILON`, which now succeed with Miri and `-Zmiri-many-seeds`
- Added a constant `APPROX_DELTA` in `std/tests/floats/f32.rs` which is used for approximation tests, but with a different value when run in Miri. This is to make these tests succeed.
- Added tests in the float tests of Miri to test the C23 behaviour.

Fixes rust-lang/miri#4208
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.

1 participant