-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2343 from lf-lang/auth-fix
Added test case for inheriting auth property
- Loading branch information
Showing
2 changed files
with
37 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// Test passes if it runs successfully. | ||
// Demonstrates inheritance of "auth" target property from import. | ||
// Also see: https://github.com/lf-lang/lingua-franca/issues/2326 | ||
target C { | ||
timeout: 1 s | ||
} | ||
|
||
import R1 from "lib/R1.lf" | ||
|
||
reactor R0 { | ||
output out: int | ||
state s: int = 0 | ||
timer t(0, 100 ms) | ||
|
||
reaction(t) -> out {= | ||
self->s ++ ; | ||
lf_set(out, self->s); | ||
lf_print("R0 is sending %d.", self->s); | ||
=} | ||
} | ||
|
||
federated reactor { | ||
r1 = new R1() | ||
r0 = new R0() | ||
r0.out -> r1.in | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
target C { | ||
auth: true | ||
} | ||
|
||
reactor R1 { | ||
input in: int | ||
|
||
reaction(in) {= | ||
lf_print("R1 reacted to input %d", in->value); | ||
=} | ||
} |