From 579d96f96a5dfd2ce2f251346338927cb373d465 Mon Sep 17 00:00:00 2001 From: Daniel Rebouta <34064225+CronKz@users.noreply.github.com> Date: Mon, 18 Nov 2024 16:24:30 +0100 Subject: [PATCH] Fixed integration tests for Windows users (#7683) --- src/CookieCrumble/src/CookieCrumble/Snapshot.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/CookieCrumble/src/CookieCrumble/Snapshot.cs b/src/CookieCrumble/src/CookieCrumble/Snapshot.cs index a626a0a5f4f..231264ed622 100644 --- a/src/CookieCrumble/src/CookieCrumble/Snapshot.cs +++ b/src/CookieCrumble/src/CookieCrumble/Snapshot.cs @@ -503,6 +503,12 @@ private static bool MatchSnapshot( bool inline, [NotNullWhen(false)] out string? snapshotDiff) { + if (OperatingSystem.IsWindows()) + { + // Normalize escaped line endings + after = after.Replace("\\r\\n", "\\n"); + } + var diff = InlineDiffBuilder.Diff(before, after); if (diff.HasDifferences)