style: rustfmt the Phase 1 test additions

The per-file Phase 1 test commits were written without running rustfmt
as I went; this pass formats the new test code (long assert_eq! lines
wrapped, etc.). Formatting-only — no behavioural change.
This commit is contained in:
2026-05-14 03:41:38 -06:00
parent 2ca8d71b94
commit 6aee6d6318
29 changed files with 466 additions and 161 deletions
+8 -2
View File
@@ -994,7 +994,10 @@ mod tests {
let c = m.vary(std::slice::from_ref(&parent), &mut rng);
c[0] != parent
});
assert!(any_changed, "InversionMutation never modified an 8-element parent across 30 seeds");
assert!(
any_changed,
"InversionMutation never modified an 8-element parent across 30 seeds"
);
}
/// `InsertionMutation` shifts an element across many seeds; at least one
@@ -1195,6 +1198,9 @@ mod tests {
let kids = erx.vary(&[p1.clone(), p2.clone()], &mut rng);
kids[0] != kids[1]
});
assert!(any_distinct, "ERX never produced distinct children across 30 seeds");
assert!(
any_distinct,
"ERX never produced distinct children across 30 seeds"
);
}
}
+15 -7
View File
@@ -733,7 +733,11 @@ mod tests {
// snapshot, by design.
fn assert_close_slice(got: &[f64], want: &[f64], tol: f64) {
assert_eq!(got.len(), want.len(), "length mismatch: got {got:?} want {want:?}");
assert_eq!(
got.len(),
want.len(),
"length mismatch: got {got:?} want {want:?}"
);
for (g, w) in got.iter().zip(want.iter()) {
assert!((g - w).abs() < tol, "got {g}, want {w}; full got = {got:?}");
}
@@ -747,7 +751,11 @@ mod tests {
let children = m.vary(std::slice::from_ref(&parent), &mut rng);
assert_close_slice(
&children[0],
&[1.034_713_959_180_981_7, 2.066_469_060_997_062_6, 3.131_288_178_686_977],
&[
1.034_713_959_180_981_7,
2.066_469_060_997_062_6,
3.131_288_178_686_977,
],
1e-12,
);
}
@@ -854,7 +862,10 @@ mod tests {
// Same seed → same δ; the only difference is the (hi-lo) factor.
// Ratio must be ≈ 10.
let ratio = wide / narrow;
assert!((ratio - 10.0).abs() < 1e-12, "ratio = {ratio}, narrow={narrow}, wide={wide}");
assert!(
(ratio - 10.0).abs() < 1e-12,
"ratio = {ratio}, narrow={narrow}, wide={wide}"
);
}
#[test]
@@ -890,10 +901,7 @@ mod tests {
fn mantegna_sigma_u_alpha_1_0_pinned() {
// alpha = 1.0: sin(π/2) = 1, gamma(2) = 1, gamma(1) = 1 → σᵤ ≈ 1.
let got = mantegna_sigma_u(1.0);
assert!(
(got - 1.0).abs() < 1e-12,
"mantegna_sigma_u(1.0) = {got}",
);
assert!((got - 1.0).abs() < 1e-12, "mantegna_sigma_u(1.0) = {got}",);
}
#[test]