From 6bdc6624ce7015cf2d34bc4366971d13ee4fcd19 Mon Sep 17 00:00:00 2001 From: Alexander Schulz-Rosengarten Date: Thu, 25 Jul 2024 19:55:13 +0200 Subject: [PATCH] kext.text: Fixed KExpression tests --- .../cau/cs/kieler/kexpressions/text/test/KExtTest.xtend | 8 +++++++- .../tests/080_scoping_simple.kext | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/test/de.cau.cs.kieler.kexpressions.text.test/src/de/cau/cs/kieler/kexpressions/text/test/KExtTest.xtend b/test/de.cau.cs.kieler.kexpressions.text.test/src/de/cau/cs/kieler/kexpressions/text/test/KExtTest.xtend index f0a665c203..1e9c782f5c 100644 --- a/test/de.cau.cs.kieler.kexpressions.text.test/src/de/cau/cs/kieler/kexpressions/text/test/KExtTest.xtend +++ b/test/de.cau.cs.kieler.kexpressions.text.test/src/de/cau/cs/kieler/kexpressions/text/test/KExtTest.xtend @@ -113,6 +113,9 @@ public class KExtTest { } } + // Serializer does not escape keywords + expected = expected.replaceAll("\\^global", "global") + if (!serialized.equals(expected)) { val StringAnnotation checkAnnotation = getAnnotation(entity, KExtTestRunner.KEXT_CHECK_ANNOTATION); failedAssertion("Serialization of " + checkAnnotation.getValues().get(0) + @@ -145,7 +148,7 @@ public class KExtTest { val entity = eObject as TestEntity; var expected = expectedLine if (entity.getExpression() !== null && expected.startsWith(KEXT_EXPRESSION_KEYWORD)) { - expected = expected.substring(11); + expected = expected.substring(11); } val serialized = SE.serializeHR(entity).toString(); @@ -155,6 +158,9 @@ public class KExtTest { expected = humanReadableAnnotation.getValues().get(0); } + // Serializer does not escape keywords + expected = expected.replaceAll("\\^global", "global") + if (!serialized.equals(expected)) { val checkAnnotation = getAnnotation(entity, KExtTestRunner.KEXT_CHECK_ANNOTATION); failedAssertion("Human readable serialization of " + checkAnnotation.getValues().get(0) + diff --git a/test/de.cau.cs.kieler.kexpressions.text.test/tests/080_scoping_simple.kext b/test/de.cau.cs.kieler.kexpressions.text.test/tests/080_scoping_simple.kext index ea21058e6b..de451afa12 100644 --- a/test/de.cau.cs.kieler.kexpressions.text.test/tests/080_scoping_simple.kext +++ b/test/de.cau.cs.kieler.kexpressions.text.test/tests/080_scoping_simple.kext @@ -35,6 +35,8 @@ B = false A = B @check "scoping.global.reference.operator#001" +@strict "global = (A & B)" +@readable "global = A & B" @aliasCheck A, globalA @aliasCheck B, globalB ^global = A & B @@ -45,6 +47,8 @@ A = B ^global = pre(A) @check "scoping.global.reference.operator#003" +@strict "global = (A & B & C)" +@readable "global = A & B & C" @aliasCheck A, globalA @aliasCheck B, globalB @aliasCheck C, globalC