From e84349531b2c8cd0d5614036ba7e05bed0b77804 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Fournier?= Date: Sun, 29 Mar 2020 09:17:49 +0200 Subject: [PATCH] Normalize line endings --- .../net/sourceforge/pmd/lang/ast/test/BaseTreeDumpTest.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/BaseTreeDumpTest.kt b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/BaseTreeDumpTest.kt index c15c0ba9a4..4e52a66651 100644 --- a/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/BaseTreeDumpTest.kt +++ b/pmd-lang-test/src/main/kotlin/net/sourceforge/pmd/lang/ast/test/BaseTreeDumpTest.kt @@ -46,7 +46,7 @@ abstract class BaseTreeDumpTest( val expected = expectedFile.readText() - assertEquals(expected, actual, "Tree dump comparison failed, see the reference: $expectedFile") + assertEquals(expected.normalize(), actual.normalize(), "Tree dump comparison failed, see the reference: $expectedFile") } // Outputting a path makes for better error messages @@ -67,6 +67,8 @@ abstract class BaseTreeDumpTest( companion object { const val ExpectedExt = ".txt" + + fun String.normalize() = replace(Regex("\\R"), "\n") } }