Sha256: 70c31a28c48befaec67f9ef65303b433dab635b19473c35a01e7e352f8d819ff

Contents?: true

Size: 1.52 KB

Versions: 2

Compression:

Stored size: 1.52 KB

Contents

#
# Testing OpenWFE
#
# John Mettraux at openwfe.org
#
# Mon Oct  9 22:19:44 JST 2006
#

require 'flowtestbase'


class FlowTest17 < FlowTestBase

    #def setup
    #end

    #def teardown
    #end

    def test_condition_0
        dotest(\
'''<process-definition name="con" revision="0">
    <if test="a == a">
        <print>ok</print>
    </if>
</process-definition>''', "ok")
    end

    def test_condition_1
        dotest(\
'''<process-definition name="con" revision="0">
    <if test="a == b">
        <print>ok</print>
    </if>
</process-definition>''', "")
    end

    def test_condition_2
        dotest(\
'''<process-definition name="con" revision="0">
    <sequence>
        <set field="toto" value="nada" />
        <if test="${f:toto} == nada">
            <print>ok</print>
        </if>
    </sequence>
</process-definition>''', "ok")
    end

    def test_condition_3
        dotest(\
'''<process-definition name="con" revision="0">
    <sequence>
        <set field="toto" value="true" />
        <if test="${f:toto}">
            <print>ok</print>
        </if>
    </sequence>
</process-definition>''', "ok")
    end

    def test_condition_4
        dotest(\
'''<process-definition name="con" revision="0">
    <if rtest="1+2 == 3">
        <print>ok</print>
    </if>
</process-definition>''', "ok")
    end

    def test_condition_5
        dotest(\
'''<process-definition name="con" revision="0">
    <if test="1+2 == 3">
        <print>ok</print>
        <print>nok</print>
    </if>
</process-definition>''', "nok")
    end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
openwferu-0.9.3 test/ft_17_condition.rb
openwferu-0.9.4 test/ft_17_condition.rb