Skip to content

Conversation

@mvorisek
Copy link
Contributor

@mvorisek mvorisek commented May 17, 2024

Without this fix tests are failing on Windows:

There were 2 failures:

1) Doctrine\SqlFormatter\Tests\SqlFormatterTest::testFormatHighlight with data set #33 ('SELECT Test FROM Test WHERE\n... = 2);', '<pre style="color: black; bac...</pre>')
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
 <span style="font-weight:bold;">FROM</span>\n
   <span style="color: #333;">Test</span>\n
 <span style="font-weight:bold;">WHERE</span>\n
-  (<span style="color: #333;">MyColumn</span> <span >=</span> <span style="color: green;">1</span>)\n
+  (<span style="color: #333;">MyColumn</span> <span >=</span> <span style="color: green;">1</span>)\r\n
 <span style="background-color: red;">)</span>\n
 <span style="font-weight:bold;">AND</span> (\n
   (\n
-    (<span style="color: #333;">SomeOtherColumn</span> <span >=</span> <span style="color: green;">2</span>)<span >;</span>\n
+    (<span style="color: #333;">SomeOtherColumn</span> <span >=</span> <span style="color: green;">2</span>)<span >;</span>\r\n
 <span style="background-color: red;">WARNING: unclosed parentheses or section</span></pre>'

2) Doctrine\SqlFormatter\Tests\SqlFormatterTest::testCliHighlight with data set #33 ('SELECT Test FROM Test WHERE\n... = 2);', 'SELECT\n  Test\n...on')
Failed asserting that two strings are equal.
--- Expected
+++ Actual
@@ @@
 FROM\n
   Test\n
 WHERE\n
-  (MyColumn = 1)\n
+  (MyColumn = 1)\r\n
 )\n
 AND (\n
   (\n
-    (SomeOtherColumn = 2);\n
+    (SomeOtherColumn = 2);\r\n
 WARNING: unclosed parentheses or section'

As all other line ends use LF solely, lets use LF also for these two error formatters.

@mvorisek mvorisek marked this pull request as ready for review May 17, 2024 10:42
@mvorisek mvorisek force-pushed the fix_tests_for_win branch from 3f29e7d to 6e6922b Compare May 17, 2024 15:39
@greg0ire greg0ire added this to the 1.4.1 milestone May 17, 2024
@greg0ire greg0ire merged commit 6eb85e0 into doctrine:1.4.x May 17, 2024
@greg0ire
Copy link
Member

Thanks @mvorisek !

@mvorisek mvorisek deleted the fix_tests_for_win branch May 17, 2024 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants