diff options
author | Galin Simeonov <gts@volconst.com> | 2021-06-03 12:38:37 +0300 |
---|---|---|
committer | Galin Simeonov <gts@volconst.com> | 2021-07-15 18:04:02 +0300 |
commit | 76fc38b3cdfded2911b464baa7b182b5102318d1 (patch) | |
tree | 389223f76086bff07a3cd762683e5a16d34d12d2 /tests | |
parent | 85b23fbee717f047af5a89eac6f4dba8e7812524 (diff) | |
download | MEGATRON-76fc38b3cdfded2911b464baa7b182b5102318d1.tar.gz |
work on generated C code
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test2 | 23 | ||||
-rw-r--r-- | tests/test3 | 26 | ||||
-rw-r--r-- | tests/test4 | 24 |
3 files changed, 55 insertions, 18 deletions
diff --git a/tests/test2 b/tests/test2 index a5342f0..f630109 100644 --- a/tests/test2 +++ b/tests/test2 @@ -1,2 +1,21 @@ -"1" -"12" +machine light_bulb +[ + states [ light_on , light_off ]; + events [ turn_on , turn_off , switch ]; + starting on light_off; + transitions + [ + from light_on to light_off on event turn_off execute kek2 | kek; + from light_on to light_off on event switch; + from light_off to light_on on event turn_on; + from light_off to light_on on event switch execute kek; + + ]; +]; +machine temp_switch +[ + states [A,B]; + events [A]; + starting on A; + transitions [from A to B on event A execute kek;]; +]; diff --git a/tests/test3 b/tests/test3 index 43e47d1..426fd2a 100644 --- a/tests/test3 +++ b/tests/test3 @@ -1,21 +1,15 @@ -machine light_bulb +machine SIREN [ - states [ light_on , light_off ]; - events [ switch_state , turn_on , turn_off ]; - - starting on light_off; - + states [ ON , OFF ]; + events [ ECHO , TURN_OFF , TURN_ON ]; + starting on ON ; transitions [ - from light_on to light_off on event switch_state execute light_switch(); - from light_off to light_on on event switch_state execute light_switch(); + from ON to OFF on event TURN_OFF; + from OFF to ON on event TURN_ON; - from light_on to light_off on event turn_on execute light_switch(); - from light_off to light_on on event turn_off execute light_switch(); - ]; -]; + from ON to ON on event ECHO + execute echo ; + ]; -transition light_switch() -{ - -} +]; diff --git a/tests/test4 b/tests/test4 new file mode 100644 index 0000000..5130059 --- /dev/null +++ b/tests/test4 @@ -0,0 +1,24 @@ +machine light_bulb +[ + states [ light_on , light_off ]; + events [ turn_on , turn_off , switch ]; + starting on light_off; + transitions + [ + from light_on to light_off on event turn_off execute kek2 | kek; + from light_on to light_off on event switch; + from light_off to light_on on event turn_on; + from light_off to light_on on event switch execute kek; + + ]; +]; +machine temp_switch +[ + states [A,B]; + events [A]; + starting on A; + transitions + [ + from ( A && !light_on ) to B on event A execute kek; + ]; +]; |