From 556e4bd1522e7ecc286de4fd8fe62acb59e2af2d Mon Sep 17 00:00:00 2001 From: giswqs Date: Sun, 22 Nov 2026 23:00:01 -0500 Subject: [PATCH] fix(engine): compare the command surface snapshot without CRLF A Windows checkout converts crates/engine/command-surface.txt to CRLF, so include_str! no longer equals the LF text the registry produces and command_surface_matches_the_snapshot fails on windows-latest with "the same ids and keys, but a repeated id or another order". Normalise the saved text's line endings before comparing. --- crates/engine/src/surface.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/engine/src/surface.rs b/crates/engine/src/surface.rs index 9205e821c3..07704c7aef 100644 --- a/crates/engine/src/surface.rs +++ b/crates/engine/src/surface.rs @@ -94,7 +94,10 @@ mod tests { let mut seen = std::collections::HashSet::new(); let twice: Vec<_> = commands.iter().filter(|c| !seen.insert(c.id)).map(|c| c.id).collect(); assert!(twice.is_empty(), "registered twice: {twice:?}"); - let (saved, current) = (include_str!("../command-surface.txt"), text(&commands)); + // A Windows checkout may turn the file's line endings into CRLF; the snapshot is LF. + let saved = include_str!("../command-surface.txt").replace("\r\n", "\n"); + let current = text(&commands); + let saved = saved.as_str(); let diff = differences(saved, ¤t); // Equal ids and keys but another text: a repeated id, or lines out of order. assert!(