test/ft_3_equals.rb in ruote-0.9.18 vs test/ft_3_equals.rb in ruote-0.9.19
- old
+ new
@@ -9,162 +9,162 @@
require 'flowtestbase'
class FlowTest3 < Test::Unit::TestCase
- include FlowTestBase
+ include FlowTestBase
- #def setup
- #end
+ #def setup
+ #end
- #def teardown
- #end
+ #def teardown
+ #end
- def test_equals_0
- dotest(
+ def test_equals_0
+ dotest(
'''<process-definition name="equals_0" revision="0">
- <sequence>
- <equals value="a" other-value="a" />
- <print>${field:__result__}</print>
- </sequence>
-</process-definition>''',
- "true")
- end
+ <sequence>
+ <equals value="a" other-value="a" />
+ <print>${field:__result__}</print>
+ </sequence>
+</process-definition>''',
+ "true")
+ end
- def test_equals_1
- dotest(
+ def test_equals_1
+ dotest(
'''<process-definition name="equals_1" revision="0">
- <sequence>
- <equals value="a" other-value="b" />
- <print>${field:__result__}</print>
- </sequence>
-</process-definition>''',
- "false")
- end
+ <sequence>
+ <equals value="a" other-value="b" />
+ <print>${field:__result__}</print>
+ </sequence>
+</process-definition>''',
+ "false")
+ end
- def test_if_0
- dotest(
+ def test_if_0
+ dotest(
'''<process-definition name="if_0" revision="0">
- <if>
- <equals value="a" other-value="a" />
- <print>ok</print>
- </if>
-</process-definition>''',
- "ok")
- end
+ <if>
+ <equals value="a" other-value="a" />
+ <print>ok</print>
+ </if>
+</process-definition>''',
+ "ok")
+ end
- def test_if_1
- dotest(
+ def test_if_1
+ dotest(
'''<process-definition name="if_1" revision="0">
- <if>
- <equals value="a" other-value="a" />
- <print>ok</print>
- <print>nok</print>
- </if>
-</process-definition>''',
- "ok")
- end
+ <if>
+ <equals value="a" other-value="a" />
+ <print>ok</print>
+ <print>nok</print>
+ </if>
+</process-definition>''',
+ "ok")
+ end
- def test_if_2
- dotest(
+ def test_if_2
+ dotest(
'''<process-definition name="if_2" revision="0">
- <if>
- <equals value="a" other-value="b" />
- <print>nok</print>
- </if>
-</process-definition>''',
- "")
- end
+ <if>
+ <equals value="a" other-value="b" />
+ <print>nok</print>
+ </if>
+</process-definition>''',
+ "")
+ end
- def test_if_3
- dotest(
+ def test_if_3
+ dotest(
'''<process-definition name="if_3" revision="0">
- <if>
- <equals value="a" other-value="b" />
- <print>nok</print>
- <print>ok</print>
- </if>
+ <if>
+ <equals value="a" other-value="b" />
+ <print>nok</print>
+ <print>ok</print>
+ </if>
</process-definition>''', "ok")
- end
+ end
- def test_equals_0
- dotest(
+ def test_equals_0
+ dotest(
'<process-definition name="'+name_of_test+'''" revision="0">
- <sequence>
- <set field="a" value="true" />
- <print>${f:a}</print>
- <if>
- <equals field-value="a" other-value="true" />
- <print>true</print>
- <print>bad test_equals_0</print>
- </if>
- </sequence>
-</process-definition>''',
+ <sequence>
+ <set field="a" value="true" />
+ <print>${f:a}</print>
+ <if>
+ <equals field-value="a" other-value="true" />
+ <print>true</print>
+ <print>bad test_equals_0</print>
+ </if>
+ </sequence>
+</process-definition>''',
"""true
true""")
- end
+ end
- def test_equals_1
- dotest(
+ def test_equals_1
+ dotest(
'<process-definition name="'+name_of_test+'''" revision="0">
- <sequence>
- <set variable="a" value="true" />
- <print>${a}</print>
- <if>
- <equals variable-value="a" other-value="true" />
- <print>true</print>
- <print>bad test_equals_1</print>
- </if>
- </sequence>
-</process-definition>''',
- "true\ntrue")
- end
+ <sequence>
+ <set variable="a" value="true" />
+ <print>${a}</print>
+ <if>
+ <equals variable-value="a" other-value="true" />
+ <print>true</print>
+ <print>bad test_equals_1</print>
+ </if>
+ </sequence>
+</process-definition>''',
+ "true\ntrue")
+ end
- def test_equals_2
- dotest(
+ def test_equals_2
+ dotest(
'<process-definition name="'+name_of_test+'''" revision="0">
- <sequence>
- <set variable="a" value="true" />
+ <sequence>
+ <set variable="a" value="true" />
- <equals variable="a" other-value="true" />
- <print>${f:__result__}</print>
+ <equals variable="a" other-value="true" />
+ <print>${f:__result__}</print>
- <equals variable="a" value="true" />
- <print>${f:__result__}</print>
- </sequence>
-</process-definition>''',
- "true\ntrue")
- end
+ <equals variable="a" value="true" />
+ <print>${f:__result__}</print>
+ </sequence>
+</process-definition>''',
+ "true\ntrue")
+ end
- def test_equals_3
+ def test_equals_3
- #log_level_to_debug
+ #log_level_to_debug
- dotest(
+ dotest(
'<process-definition name="'+name_of_test+'''" revision="0">
- <sequence>
- <if test="3 > 2">
- <print>ok0</print>
- </if>
- <if test="3 > a">
- <print>bad</print>
- <print>ok1</print>
- </if>
- <if test="3>a">
- <print>bad</print>
- <print>ok2</print>
- </if>
- <if test="3 > 2">
- <print>ok3</print>
- <print>bad</print>
- </if>
- <if test="1 < 2.0">
- <print>ok4</print>
- <print>bad</print>
- </if>
- </sequence>
-</process-definition>''',
- (0..4).collect { |i| "ok#{i}" }.join("\n"))
- end
+ <sequence>
+ <if test="3 > 2">
+ <print>ok0</print>
+ </if>
+ <if test="3 > a">
+ <print>bad</print>
+ <print>ok1</print>
+ </if>
+ <if test="3>a">
+ <print>bad</print>
+ <print>ok2</print>
+ </if>
+ <if test="3 > 2">
+ <print>ok3</print>
+ <print>bad</print>
+ </if>
+ <if test="1 < 2.0">
+ <print>ok4</print>
+ <print>bad</print>
+ </if>
+ </sequence>
+</process-definition>''',
+ (0..4).collect { |i| "ok#{i}" }.join("\n"))
+ end
end