Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cmnrd committed Mar 23, 2022
1 parent a5a073b commit f9dd4ec
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -906,8 +906,8 @@ public void nonzeroAfterMustHaveUnits() throws Exception {
" b = new X()",
" a.y -> b.x after 1",
"}");
validator.assertError(parseWithoutError(testCase), LfPackage.eINSTANCE.getTime(),
null, "Missing or invalid time unit.");
validator.assertError(parseWithoutError(testCase), LfPackage.eINSTANCE.getConnection(),
null, "Missing time unit.");
}


Expand Down
4 changes: 2 additions & 2 deletions org.lflang/src/org/lflang/validation/LFValidator.java
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,10 @@ public void checkConnection(Connection connection) {
// Check the after delay
if (connection.getDelay() != null) {
final var delay = connection.getDelay();
if (delay instanceof ParameterReference || delay instanceof Time) {
if (delay instanceof ParameterReference || delay instanceof Time || delay instanceof Literal) {
checkExpressionAsTime(delay, Literals.CONNECTION__DELAY);
} else {
error("After delays can only be given by time literals or paramters.",
error("After delays can only be given by time literals or parameters.",
Literals.CONNECTION__DELAY);
}
}
Expand Down

0 comments on commit f9dd4ec

Please sign in to comment.