From 1796da69b8b073b047d3b8eaae70141936f058d0 Mon Sep 17 00:00:00 2001 From: Pieter Olivier Date: Fri, 4 Oct 2024 12:17:19 +0200 Subject: [PATCH] Fixed end-of-line sequence to the source end-of-lines This should make the tests succeed on the Windows CI machine --- .../rascal/tests/concrete/recovery/PicoRecoveryTests.rsc | 8 +++++--- .../tests/concrete/recovery/RascalRecoveryTests.rsc | 4 ++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/PicoRecoveryTests.rsc b/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/PicoRecoveryTests.rsc index b7fa7926d9..941b4c7128 100644 --- a/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/PicoRecoveryTests.rsc +++ b/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/PicoRecoveryTests.rsc @@ -26,7 +26,7 @@ Tree parsePico(str input, bool visualize=false) bool checkError(Tree t, str expectedError) { str bestError = getErrorText(findBestError(t)); - println("best error: , expected: "); + //println("best error: , expected: "); return size(bestError) == size(expectedError); } @@ -88,7 +88,8 @@ test bool picoMissingSemi() { input := input - 1 od end"); - return checkError(t, "input := input - 1\n od"); + return checkError(t, "input := input - 1 + od"); } test bool picoTypoSmall() { @@ -112,5 +113,6 @@ test bool picoMissingSemiSmall() { od end"); - return checkError(t, "output := 0\n od"); + return checkError(t, "output := 0 + od"); } \ No newline at end of file diff --git a/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/RascalRecoveryTests.rsc b/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/RascalRecoveryTests.rsc index 9e0332422c..b60c79df0a 100644 --- a/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/RascalRecoveryTests.rsc +++ b/src/org/rascalmpl/library/lang/rascal/tests/concrete/recovery/RascalRecoveryTests.rsc @@ -19,8 +19,11 @@ import lang::rascal::\syntax::Rascal; import ParseTree; import IO; +bool debugging = false; + Tree parseRascal(type[&T] t, str input, bool visualize=false) { Tree result = parser(t, allowRecovery=true, allowAmbiguity=true)(input, |unknown:///?visualize=<"">|); + if (debugging) { list[Tree] errors = findAllErrors(result); if (errors != []) { println("Tree has errors"); @@ -31,6 +34,7 @@ Tree parseRascal(type[&T] t, str input, bool visualize=false) { Tree disambiguated = defaultErrorDisambiguationFilter(result); println("Best error: "); } + } return result; }