Permalink
Browse files

Added new test for assign-current-small-step.

  • Loading branch information...
1 parent 3a9b076 commit 5b816f74f19932cc0e72d23572681373638f8532 @jbeard4 committed Mar 12, 2012
Showing with 60 additions and 0 deletions.
  1. +13 −0 src/test/assign-current-small-step/test4.json
  2. +47 −0 src/test/assign-current-small-step/test4.scxml
View
13 src/test/assign-current-small-step/test4.json
@@ -0,0 +1,13 @@
+{
+ "initialConfiguration" : ["a"],
+ "events" : [
+ {
+ "event" : { "name" : "t" },
+ "nextConfiguration" : ["c"]
+ }
+ ]
+}
+
+
+
+
View
47 src/test/assign-current-small-step/test4.scxml
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright 2011-2012 Jacob Beard, INFICON, and other SCION contributors
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+<scxml
+ xmlns="http://www.w3.org/2005/07/scxml"
+ version="1.0" >
+
+ <datamodel>
+ <data id="x" expr="3"/>
+ </datamodel>
+
+ <state id="a">
+ <!-- in order for this transition to be taken, a must be updated immediately, in the same small-step -->
+ <transition event="t" target="b">
+ <assign location="x" expr="x + 1"/> <!-- 4 -->
+ <log expr="'x : ' + x"/>
+ <assign location="x" expr="x * 2"/> <!-- 8 -->
+ <log expr="'x : ' + x"/>
+ <assign location="x" expr="Math.pow(x,3)"/> <!-- 512 -->
+ <log expr="'x : ' + x"/>
+ </transition>
+ </state>
+
+ <state id="b">
+ <transition target="c" cond="x === 512"/>
+ <transition target="f"/>
+ </state>
+
+ <state id="c"/>
+
+ <state id="f"/>
+
+</scxml>
+

0 comments on commit 5b816f7

Please sign in to comment.