summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authoralexzhornyak <alexander.zhornyak@gmail.com>2017-05-08 06:43:55 (GMT)
committeralexzhornyak <alexander.zhornyak@gmail.com>2017-05-08 06:43:55 (GMT)
commit3654c1e42a3145658b2503309b74d0ad6c4066ea (patch)
tree04a49bc399c03e1031feb012b3173dc0deff70e5 /test
parent4f2dee08e0e77fcccd55a17add874f4a1ebc1be8 (diff)
downloaduscxml-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.scxml43
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(&quot;Hello from function&quot;)
+end
+ </data>
+ <data id="varFunc2">function()
+ return 2
+end
+ </data>
+ <data expr="nil" id="varFunc3"/>
+ </datamodel>
+ <final id="Pass">
+ <onentry>
+ <log expr="&quot;Pass&quot;" label="Outcome"/>
+ </onentry>
+ </final>
+ <final id="Fail">
+ <onentry>
+ <log expr="&quot;Fail&quot;" 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(&quot;this is from Script!&quot;)
+
+print(string.format(&quot;varFunc3()==%d&quot;,varFunc3()))
+print(string.format(&quot;varFunc2()==%d&quot;,varFunc2()))
+
+varFunc1()
+
+print(string.format(&quot;varFunc4()==%d&quot;,varFunc4()))
+ </script>
+ </onentry>
+ <transition cond="varFunc4()==4 and varFunc3()==2" target="Pass"/>
+ <transition target="Fail"/>
+ </state>
+</scxml> \ No newline at end of file