Skip to content

Commit

Permalink
test: update bankindex test
Browse files Browse the repository at this point in the history
  • Loading branch information
Depetrol committed Sep 26, 2024
1 parent a676df5 commit 10aa8ac
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion test/Python/src/federated/BankIndex.lf
Original file line number Diff line number Diff line change
@@ -1,11 +1,28 @@
target Python

reactor A(bank_index=0) {
reaction(startup) {=
output out

reaction(startup) -> out {=
print("bank_index: {:d}".format(self.bank_index))
out.set(self.bank_index)
=}
}

reactor B(STA = 1 s) {
input[4] inp

reaction(inp) {=
for i, port in enumerate(inp):
assert port.is_present
print("in[{:d}]: {:d}".format(i, port.value))
assert port.value == i
request_stop()
=}
}

federated reactor {
a = new[4] A()
b = new B()
a.out -> b.inp
}

0 comments on commit 10aa8ac

Please sign in to comment.