From 678c6bb76b3c5ac6dd505f3241394478a9333fe7 Mon Sep 17 00:00:00 2001 From: Marten Lohstroh Date: Wed, 24 Jan 2024 15:45:28 -0800 Subject: [PATCH] Add test --- .../compiler/LinguaFrancaValidationTest.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/core/src/test/java/org/lflang/tests/compiler/LinguaFrancaValidationTest.java b/core/src/test/java/org/lflang/tests/compiler/LinguaFrancaValidationTest.java index 2d95e0ac4a..11fff6c2c9 100644 --- a/core/src/test/java/org/lflang/tests/compiler/LinguaFrancaValidationTest.java +++ b/core/src/test/java/org/lflang/tests/compiler/LinguaFrancaValidationTest.java @@ -108,6 +108,29 @@ private Model parseWithError(String s) throws Exception { return model; } + /** Assert no issues when multiple labels are used. */ + @Test + public void multipleLabels() throws Exception { + String testCase = + """ + target C + reactor Source { + output out: int + timer t(1 nsec, 10 msec) + state s: int = 0 + + @label(value="Foo") + reaction(startup) {= lf_print("Starting Source"); =} + + @label(value="Bar") + reaction(t) -> out {= + lf_set(out, self->s++); + lf_print("Inside source reaction_0"); + =} + }"""; + validator.assertNoIssues(parseWithoutError(testCase)); + } + /** Ensure that duplicate identifiers for actions reported. */ @Test public void tracingOptionsCpp() throws Exception {