diff options
author | alexzhornyak <alexander.zhornyak@gmail.com> | 2017-05-08 06:43:55 (GMT) |
---|---|---|
committer | alexzhornyak <alexander.zhornyak@gmail.com> | 2017-05-08 06:43:55 (GMT) |
commit | 3654c1e42a3145658b2503309b74d0ad6c4066ea (patch) | |
tree | 04a49bc399c03e1031feb012b3173dc0deff70e5 /test | |
parent | 4f2dee08e0e77fcccd55a17add874f4a1ebc1be8 (diff) | |
download | uscxml-3654c1e42a3145658b2503309b74d0ad6c4066ea.zip uscxml-3654c1e42a3145658b2503309b74d0ad6c4066ea.tar.gz uscxml-3654c1e42a3145658b2503309b74d0ad6c4066ea.tar.bz2 |
Fix issue 116
Creating temporary variable for assigning function
Diffstat (limited to 'test')
-rw-r--r-- | test/issues/test-issue116.scxml | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/test/issues/test-issue116.scxml b/test/issues/test-issue116.scxml new file mode 100644 index 0000000..ca1cc56 --- /dev/null +++ b/test/issues/test-issue116.scxml @@ -0,0 +1,43 @@ +<scxml datamodel="lua" initial="StateShape1" name="ScxmlShape1" version="1.0" xmlns="http://www.w3.org/2005/07/scxml"> + <datamodel> + <data id="varFunc1">function() + print("Hello from function") +end + </data> + <data id="varFunc2">function() + return 2 +end + </data> + <data expr="nil" id="varFunc3"/> + </datamodel> + <final id="Pass"> + <onentry> + <log expr=""Pass"" label="Outcome"/> + </onentry> + </final> + <final id="Fail"> + <onentry> + <log expr=""Fail"" label="Outcome"/> + </onentry> + </final> + <state id="StateShape1"> + <onentry> + <assign expr="varFunc2" location="varFunc3"/> + <assign expr="function() + return 4 +end" location="varFunc4"/> + <log expr="''" label="Test"/> + <script>print("this is from Script!") + +print(string.format("varFunc3()==%d",varFunc3())) +print(string.format("varFunc2()==%d",varFunc2())) + +varFunc1() + +print(string.format("varFunc4()==%d",varFunc4())) + </script> + </onentry> + <transition cond="varFunc4()==4 and varFunc3()==2" target="Pass"/> + <transition target="Fail"/> + </state> +</scxml>
\ No newline at end of file |