diff options
Diffstat (limited to 'test/w3c/lua/test152.scxml')
-rw-r--r-- | test/w3c/lua/test152.scxml | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/test/w3c/lua/test152.scxml b/test/w3c/lua/test152.scxml new file mode 100644 index 0000000..1147c4b --- /dev/null +++ b/test/w3c/lua/test152.scxml @@ -0,0 +1,41 @@ +<?xml version="1.0" standalone="no"?> +<!-- test that an illegal array or item value causes error.execution and results in executable content +not being executed. --> +<scxml xmlns="http://www.w3.org/2005/07/scxml" initial="s0" version="1.0" datamodel="lua"> + <datamodel> + <data expr="0" id="testvar1"/> + <data id="testvar2"/> + <data id="testvar3"/> + <data expr="7" id="testvar4"/> + <data id="testvar5">{1,2,3}</data> + </datamodel> + <state id="s0"> + <onentry> + <!-- invalid array, legal item --> + <foreach array="testvar4" index="testvar3" item="testvar2"> + <assign location="testvar1" expr="testvar1+1"/> + </foreach> + <raise event="foo"/> + </onentry> + <transition event="error.execution" target="s1"/> + <transition event="*" target="fail"/> + </state> + <state id="s1"> + <onentry> + <!-- illegal item, legal array --> + <foreach array="testvar5" index="testvar3" item="_no"> + <assign location="testvar1" expr="testvar1+1"/> + </foreach> + <raise event="bar"/> + </onentry> + <transition event="error.execution" target="s2"/> + <transition event="bar" target="fail"/> + </state> + <state id="s2"> + <!-- check that var1 has its original value (so executable content never got executed --> + <transition cond="testvar1 == 0" target="pass"/> + <transition target="fail"/> + </state> + <final id="pass"/> + <final id="fail"/> +</scxml> |