From 9afe2296a6b66d1415561181a2f77955d43a6a09 Mon Sep 17 00:00:00 2001 From: Fabio Ivona Date: Wed, 2 Aug 2023 10:23:27 +0200 Subject: [PATCH] fix line endings on Windows --- src/Mixins/Expectation.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/Mixins/Expectation.php b/src/Mixins/Expectation.php index fe49cb0f..d3d8cbd3 100644 --- a/src/Mixins/Expectation.php +++ b/src/Mixins/Expectation.php @@ -827,14 +827,13 @@ final class Expectation [$filename, $content] = $snapshots->get(); Assert::assertSame( - $content, - $string, + strtr($content, ["\r\n" => "\n", "\r" => "\n"]), + strtr($string, ["\r\n" => "\n", "\r" => "\n"]), $message === '' ? "Failed asserting that the string value matches its snapshot ($filename)." : $message ); } else { $filename = $snapshots->save($string); - // $testCase::markTestIncomplete('Snapshot created at ['.$filename.'].'); TestSuite::getInstance()->registerSnapshotChange("Snapshot created at [$filename]"); }