From b44a55a48dafa7171c098b75d53fcae4a52f9a09 Mon Sep 17 00:00:00 2001 From: "Jurgen J. Vinju" Date: Wed, 2 Sep 2020 14:23:42 +0200 Subject: [PATCH] added test for visit not removing keyword field .src --- .../lang/rascal/tests/concrete/Locations.rsc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/org/rascalmpl/library/lang/rascal/tests/concrete/Locations.rsc b/src/org/rascalmpl/library/lang/rascal/tests/concrete/Locations.rsc index 64004e53389..5a7ea079795 100644 --- a/src/org/rascalmpl/library/lang/rascal/tests/concrete/Locations.rsc +++ b/src/org/rascalmpl/library/lang/rascal/tests/concrete/Locations.rsc @@ -15,4 +15,22 @@ test bool concreteExpressionsHaveSourceLocationsLegacy1() test bool concreteExpressionsHaveSourceLocationsLegacy2() = (A) `a`@\loc.length == 1; + +test bool concreteExpressionsHaveSourceLocationsAfterVisitWithMatch() { + assert /int _ := (A) `a`; + + t = visit((A) `a`) { + case int i => i + 1 + } + + return t@\loc?; +} + +test bool concreteExpressionsHaveSourceLocationsAfterVisitWithNoMatch() { + t = visit((A) `a`) { + case 1239461234912634 => 123498761234896123 + } + + return t@\loc?; +} \ No newline at end of file