test/ft_10_loop.rb in openwferu-0.9.2 vs test/ft_10_loop.rb in openwferu-0.9.3
- old
+ new
@@ -8,28 +8,28 @@
#
require 'flowtestbase'
+$s = ""
+0.upto(9) do |i|
+ $s << i.to_s
+ $s << "\n"
+end
+$s = $s.strip()
+
+
class FlowTest10 < FlowTestBase
#def setup
#end
#def teardown
#end
def test_loop_0
-
- s = ""
- 0.upto(9) do |i|
- s << i.to_s
- s << "\n"
- end
- s = s.strip()
-
- dotest(\
+ dotest(
'<process-definition name="'+test_name+'''" revision="0">
<sequence>
<reval>$i = 0</reval>
<loop>
<print>${r:$i}</print>
@@ -39,10 +39,72 @@
<break/>
</if>
</loop>
</sequence>
</process-definition>''',
- s)
+ $s)
+ end
+
+ def test_loop_1
+ dotest(
+'<process-definition name="'+test_name+'''" revision="0">
+ <sequence>
+ <reval>$i = 0</reval>
+ <loop>
+ <print>${r:$i}</print>
+ <reval>$i = $i + 1</reval>
+ <if rtest="$i == 10">
+ <break/>
+ </if>
+ </loop>
+ </sequence>
+</process-definition>''',
+ $s)
+ end
+
+ def test_loop_2
+ dotest(
+'<process-definition name="'+test_name+'''" revision="0">
+ <sequence>
+ <reval>$i = 0</reval>
+ <loop>
+ <print>${r:$i}</print>
+ <reval>$i = $i + 1</reval>
+ <break if="${r:$i} == 10" />
+ </loop>
+ </sequence>
+</process-definition>''',
+ $s)
+ end
+
+ def test_loop_3
+ dotest(
+'<process-definition name="'+test_name+'''" revision="0">
+ <sequence>
+ <reval>$i = 0</reval>
+ <loop>
+ <print>${r:$i}</print>
+ <reval>$i = $i + 1</reval>
+ <break if="${r:$i == 10}" />
+ </loop>
+ </sequence>
+</process-definition>''',
+ $s)
+ end
+
+ def test_loop_4
+ dotest(
+'<process-definition name="'+test_name+'''" revision="0">
+ <sequence>
+ <reval>$i = 0</reval>
+ <loop>
+ <print>${r:$i}</print>
+ <reval>$i = $i + 1</reval>
+ <break rif="$i == 10" />
+ </loop>
+ </sequence>
+</process-definition>''',
+ $s)
end
end