Skip to content

Commit 2fff7fd

Browse files
committed
Fix detection of errors after rename tests.
1 parent 23d0fbd commit 2fff7fd

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

  • rascal-lsp/src/main/rascal/lsp/lang/rascal/tests/rename

rascal-lsp/src/main/rascal/lsp/lang/rascal/tests/rename/TestUtils.rsc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ private void verifyTypeCorrectRenaming(loc root, list[DocumentEdit] edits, PathC
8080
assert size(editLocs) == size(toSet(editLocs)) : "Duplicate locations in suggested edits - VS Code cannot handle this";
8181
8282
RascalCompilerConfig ccfg = rascalCompilerConfig(pcfg)[verbose = false][logPathConfig = false];
83-
checkBefore = checkAll(root, ccfg);
83+
list[ModuleMessages] checkBefore = checkAll(root, ccfg);
8484
8585
// Back-up sources
8686
loc backupLoc = |memory://tests/backup|;
@@ -90,10 +90,12 @@ private void verifyTypeCorrectRenaming(loc root, list[DocumentEdit] edits, PathC
9090
executeDocumentEdits(sortEdits(groupEditsByFile(edits)));
9191
remove(pcfg.bin, recursive = true);
9292

93-
checkAfter = checkAll(root, ccfg);
93+
list[ModuleMessages] checkAfter = checkAll(root, ccfg);
9494
newMsgs = checkAfter - checkBefore;
9595

96-
if (newErrors: [_, *_] := [m | m <- newMsgs, m is error]) throw newErrors;
96+
if (newErrors: [_, *_] := [e | program(_, msgs) <- newMsgs, e <- msgs, e is error]) {
97+
throw newErrors;
98+
}
9799

98100
// Restore back-up
99101
remove(root, recursive = true);

0 commit comments

Comments
 (0)