-
-
Notifications
You must be signed in to change notification settings - Fork 33
Fix stacked borrow violation and add miri CI #25
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,13 +51,15 @@ fn test_ryu() { | |
|
|
||
| #[test] | ||
| fn test_random() { | ||
| let n = if cfg!(miri) { 100 } else { 1000000 }; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, I like this style... so far I always used |
||
| let mut buffer = ryu::Buffer::new(); | ||
| for _ in 0..1000000 { | ||
| for _ in 0..n { | ||
| let f: f64 = rand::random(); | ||
| assert_eq!(f, buffer.format_finite(f).parse().unwrap()); | ||
| } | ||
| } | ||
|
|
||
| #[cfg(not(miri))] | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FWIW, the usual alternative I use these days is It doesn't really make a difference, though. |
||
| #[test] | ||
| fn test_non_finite() { | ||
| for i in 0u64..1 << 23 { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great to see Miri being added here. :)
cargo miri testwill interactively ask for confirmation to install things, and will probably not work. Miri is just not available for the latest nightly so right now we do not enter this code path.The recommended Miri CI integration is given in our README.