* WIP deep rename (not for push) * WIP2 * WIP3 * WIP4 wxs fix * rustfmt * Rename the remaining identifiers in merged crash-report code Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RjGw4gA5ZvKrU8MQP6sBgT --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
32 lines
1.4 KiB
Rust
32 lines
1.4 KiB
Rust
//! Seed ranges must not crash or wrap, including at the last representable seed.
|
|
|
|
use std::process::Command;
|
|
|
|
#[test]
|
|
fn overflowing_seed_range_is_an_error_not_a_panic() {
|
|
let output =
|
|
Command::new(env!("CARGO_BIN_EXE_solidcraft-cli")).args(["fuzz", "--from", "18446744073709551615", "--count", "2"]).output().unwrap();
|
|
assert_eq!(output.status.code(), Some(1));
|
|
let stderr = String::from_utf8_lossy(&output.stderr);
|
|
assert!(stderr.contains("seed range exceeds u64::MAX"), "{stderr}");
|
|
assert!(!stderr.contains("panicked"), "{stderr}");
|
|
}
|
|
|
|
#[test]
|
|
fn empty_seed_range_at_maximum_is_valid() {
|
|
let output =
|
|
Command::new(env!("CARGO_BIN_EXE_solidcraft-cli")).args(["fuzz", "--from", "18446744073709551615", "--count", "0"]).output().unwrap();
|
|
assert!(output.status.success(), "{}", String::from_utf8_lossy(&output.stderr));
|
|
assert!(String::from_utf8_lossy(&output.stdout).starts_with("0 seeds, 0 design steps,"));
|
|
}
|
|
|
|
#[test]
|
|
fn maximum_seed_runs_once_without_wrapping() {
|
|
let output = Command::new(env!("CARGO_BIN_EXE_solidcraft-cli"))
|
|
.args(["fuzz", "--from", "18446744073709551615", "--count", "1", "--steps", "0", "--timeout", "0"])
|
|
.output()
|
|
.unwrap();
|
|
assert!(output.status.success(), "{}", String::from_utf8_lossy(&output.stderr));
|
|
assert!(String::from_utf8_lossy(&output.stdout).starts_with("1 seeds,"));
|
|
}
|