diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..2688725 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,5 @@ +# Keep snapshot test fixtures LF-only across all platforms so that +# Windows checkouts with core.autocrlf=true don't convert them to CRLF +# (which would mismatch the actual JSON serialization output during +# snapshot comparison). +src/control/snapshots/*.json text eol=lf diff --git a/src/control/queries.rs b/src/control/queries.rs index 8e4fcdc..7547192 100644 --- a/src/control/queries.rs +++ b/src/control/queries.rs @@ -1272,6 +1272,9 @@ mod tests { } let expected = std::fs::read_to_string(&path) .unwrap_or_else(|e| panic!("failed to read snapshot {}: {e}", path.display())); + // Normalize line endings: Windows checkouts with core.autocrlf=true + // convert fixture files to CRLF; the in-memory JSON output is LF. + let expected = expected.replace("\r\n", "\n"); // Tolerate trailing newline differences from editors. if expected.trim_end() != actual.trim_end() { panic!(