Skip to content

Commit

Permalink
kext.text: Fixed KExpression tests
Browse files Browse the repository at this point in the history
  • Loading branch information
a-sr committed Jul 25, 2024
1 parent 646be7e commit 6bdc662
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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) +
Expand Down Expand Up @@ -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();
Expand All @@ -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) +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 6bdc662

Please sign in to comment.