From 145e3c8b1151c325809541ebf95e30f0a4767a1f Mon Sep 17 00:00:00 2001 From: Jeroen Schweitzer Date: Mon, 27 Jul 2026 01:38:42 +0200 Subject: [PATCH] style(simulation): cargo fmt the extent-inversion tests MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hand-written test bodies in step_canvas.rs did not match rustfmt. Caught by the pre-push gate, which is exactly its job — team-patterns.md's note that fmt auto-fixes and clippy is a quick lead patch, rather than something agents should pre-emptively duplicate. No behaviour change. Co-Authored-By: Claude --- server/src/atlas/step_canvas.rs | 36 ++++++++++++++++++++++++--------- 1 file changed, 26 insertions(+), 10 deletions(-) diff --git a/server/src/atlas/step_canvas.rs b/server/src/atlas/step_canvas.rs index eddb3ea33..bb639c6c0 100644 --- a/server/src/atlas/step_canvas.rs +++ b/server/src/atlas/step_canvas.rs @@ -1677,8 +1677,14 @@ mod tests { StepCanvasRung::Quarter.extent_m(), Some(scale::QUARTER_M as f64) ); - assert_eq!(StepCanvasRung::Block.extent_m(), Some(scale::BLOCK_M as f64)); - assert_eq!(StepCanvasRung::Chunk.extent_m(), Some(scale::CHUNK_M as f64)); + assert_eq!( + StepCanvasRung::Block.extent_m(), + Some(scale::BLOCK_M as f64) + ); + assert_eq!( + StepCanvasRung::Chunk.extent_m(), + Some(scale::CHUNK_M as f64) + ); assert_eq!(StepCanvasRung::Global.extent_m(), None); } @@ -1929,15 +1935,19 @@ mod tests { #[test] fn global_rung_stays_two_to_one_at_every_viewport_shape() { for req in [ - (960u32, 540u32), // 16:9 landscape — height-bound - (540, 960), // portrait — height is huge, width binds - (700, 700), // square - (4000, 100), // absurdly wide - (1, 1), // degenerate + (960u32, 540u32), // 16:9 landscape — height-bound + (540, 960), // portrait — height is huge, width binds + (700, 700), // square + (4000, 100), // absurdly wide + (1, 1), // degenerate (u32::MAX, u32::MAX), // adversarial ] { let (w, h) = resolve_canvas_extent(StepCanvasRung::Global, req, 6371.0); - assert_eq!(w, h * 2, "request {req:?} produced a non-2:1 canvas {w}x{h}"); + assert_eq!( + w, + h * 2, + "request {req:?} produced a non-2:1 canvas {w}x{h}" + ); assert!(h >= 1, "request {req:?} collapsed the canvas to zero rows"); } } @@ -1947,8 +1957,14 @@ mod tests { #[test] fn global_rung_still_clamps_an_adversarial_extent() { let (w, h) = resolve_canvas_extent(StepCanvasRung::Global, (u32::MAX, u32::MAX), 6371.0); - assert!(w <= STEP_CANVAS_MAX_EXTENT_AXIS, "width {w} escaped the axis cap"); - assert!(h <= STEP_CANVAS_MAX_EXTENT_AXIS, "height {h} escaped the axis cap"); + assert!( + w <= STEP_CANVAS_MAX_EXTENT_AXIS, + "width {w} escaped the axis cap" + ); + assert!( + h <= STEP_CANVAS_MAX_EXTENT_AXIS, + "height {h} escaped the axis cap" + ); } /// A body with no radius is not a sphere (asteroid belt, oort cloud) and