Skip to content
This repository has been archived by the owner on Sep 25, 2018. It is now read-only.

Commit

Permalink
Added new test for assign-current-small-step.
Browse files Browse the repository at this point in the history
  • Loading branch information
jbeard4 committed Mar 12, 2012
1 parent 3a9b076 commit 5b816f7
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/test/assign-current-small-step/test4.json
@@ -0,0 +1,13 @@
{
"initialConfiguration" : ["a"],
"events" : [
{
"event" : { "name" : "t" },
"nextConfiguration" : ["c"]
}
]
}




47 changes: 47 additions & 0 deletions 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.