rust-random / rand

A Rust library for random number generation.
https://crates.io/crates/rand
Other
1.67k stars 431 forks source link

Test trying to write to /tmp/random.bytes #1293

Closed bjorn3 closed 1 year ago

bjorn3 commented 1 year ago

/tmp may not exist (for example on Windows), or /tmp/random.bytes may be owned by another user. This is causing cargo test --workspace to fail on Windows: https://github.com/bjorn3/rustc_codegen_cranelift/actions/runs/4275370282/jobs/7442671959

https://github.com/rust-random/rand/blob/7c1e649ea1b8074046712e07272d18a3d85bcc71/rand_core/src/lib.rs#L459

dhardy commented 1 year ago

From #1267 by @SUPERCILEX. Guess I should review doc-tests better; sorry.

Tests shouldn't really affect any files, so writing to a temporary buffer would make more sense.

SUPERCILEX commented 1 year ago

Oops, forgot that stuff gets run. Should we just mark it as no_run? I don't see the value in actually executing that code since it doesn't check anything anyway.

dhardy commented 1 year ago

That sounds fine.