diff options
author | Galin Simeonov <gts@volconst.com> | 2021-06-04 16:42:52 +0300 |
---|---|---|
committer | Galin Simeonov <gts@volconst.com> | 2021-07-15 18:04:59 +0300 |
commit | a26684a417729699e95b335a3d00798237ffba9b (patch) | |
tree | 6cd73bc90fbe5fd435b8cc721455d0a70420a4ac /tests | |
parent | b845e4754be86d2216733d9bea75cb301f38739d (diff) | |
download | MEGATRON-a26684a417729699e95b335a3d00798237ffba9b.tar.gz |
added the if statement
Diffstat (limited to 'tests')
-rw-r--r-- | tests/.test6.swp (renamed from tests/.test5.swp) | bin | 12288 -> 12288 bytes | |||
-rw-r--r-- | tests/test4 | 4 | ||||
-rw-r--r-- | tests/test5 | 7 | ||||
-rw-r--r-- | tests/test6 | 26 |
4 files changed, 34 insertions, 3 deletions
diff --git a/tests/.test5.swp b/tests/.test6.swp Binary files differindex 6e03612..dc85c11 100644 --- a/tests/.test5.swp +++ b/tests/.test6.swp diff --git a/tests/test4 b/tests/test4 index 579e54d..4610e2c 100644 --- a/tests/test4 +++ b/tests/test4 @@ -19,6 +19,8 @@ machine temp_switch starting on A; transitions [ - from ( !A && !light_on ) to B on event A execute kek; + from A to B on event A + if !light_bulb.light_on + execute kek; ]; ]; diff --git a/tests/test5 b/tests/test5 index fc9ff67..fb72d41 100644 --- a/tests/test5 +++ b/tests/test5 @@ -5,7 +5,10 @@ machine A starting on A; transitions [ - from A to A on event A given (B.C && !C.D) - execute eke; + from A to A on event A + if (A.A && !A.A) + execute eke; + else + execute asdf; ]; ]; diff --git a/tests/test6 b/tests/test6 new file mode 100644 index 0000000..3fed6d3 --- /dev/null +++ b/tests/test6 @@ -0,0 +1,26 @@ +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 granted !light_bulb.light_on + if !light_bulb.light_on + execute kek; + ]; +]; |