diff --git a/src/Verify/IoHelpers.cs b/src/Verify/IoHelpers.cs index 277697f3cb..4db6df4eab 100644 --- a/src/Verify/IoHelpers.cs +++ b/src/Verify/IoHelpers.cs @@ -117,8 +117,12 @@ public static async Task ReadStringBuilderWithFixedLines(this Str { stream.MoveToStart(); using var reader = new StreamReader(stream); - var builder = new StringBuilder(await reader.ReadToEndAsync()); - builder.FixNewlines(); + var contents = await reader.ReadToEndAsync(); + var builder = new StringBuilder(contents); + if (contents.Contains('\n')) + { + builder.FixNewlines(); + } return builder; }