#
# Testing OpenWFE
#
# John Mettraux at openwfe.org
#
# Mon Oct 9 22:19:44 JST 2006
#
require 'flowtestbase'
class FlowTest3 < Test::Unit::TestCase
include FlowTestBase
#def setup
#end
#def teardown
#end
def test_equals_0
dotest(
'''
${field:__result__}
''',
"true")
end
def test_equals_1
dotest(
'''
${field:__result__}
''',
"false")
end
def test_if_0
dotest(
'''
ok
''',
"ok")
end
def test_if_1
dotest(
'''
ok
nok
''',
"ok")
end
def test_if_2
dotest(
'''
nok
''',
"")
end
def test_if_3
dotest(
'''
nok
ok
''', "ok")
end
def test_equals_0
dotest(
'
${f:a}
true
bad test_equals_0
''',
"""true
true""")
end
def test_equals_1
dotest(
'
${a}
true
bad test_equals_1
''',
"true\ntrue")
end
def test_equals_2
dotest(
'
${f:__result__}
${f:__result__}
''',
"true\ntrue")
end
def test_equals_3
#log_level_to_debug
dotest(
'
ok0
bad
ok1
bad
ok2
ok3
bad
ok4
bad
''',
(0..4).collect { |i| "ok#{i}" }.join("\n"))
end
end