<?xml version="1.0" encoding="UTF-8"?>
<test-data
    xmlns="http://pmd.sourceforge.net/rule-tests"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://pmd.sourceforge.net/rule-tests http://pmd.sourceforge.net/rule-tests_1_0_0.xsd">

    <test-code>
        <description>Bad example #1</description>
        <rule-property name="problemDepth">3</rule-property>
        <expected-problems>1</expected-problems>
        <code><![CDATA[
#if( $XHTML )
    #set( $br = "<br />" )
    #if ($someValue)
        #if ($otherValue)
            do stuff
        #end
    #end
#else
    #set( $br = "<br>" )
#end
        ]]></code>
    </test-code>

    <test-code>
        <description>Bad example #2</description>
        <rule-property name="problemDepth">3</rule-property>
        <expected-problems>2</expected-problems>
        <code><![CDATA[
#if( $XHTML )
    #set( $br = "<br />" )
    #if ($someValue)
        #if ($otherValue)
            do stuff
        #end
    #end
#elseif ($condition2)
    #set( $br = "<br>" )
    #if ($condition3)
        something
    #end
#end
        ]]></code>
    </test-code>

    <test-code>
        <description>Good example #1</description>
        <rule-property name="problemDepth">3</rule-property>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
#if( $XHTML )
    #set( $br = "<br />" )
    #if ($someValue)
        do something
    #end
#else
    #set( $br = "<br>" )
#end
        ]]></code>
    </test-code>

    <test-code>
        <description>Good example #2</description>
        <rule-property name="problemDepth">3</rule-property>
        <expected-problems>0</expected-problems>
        <code><![CDATA[
#if( $XHTML )
    #set( $br = "<br />" )
    #if ($someValue)
        do something
    #end
#elseif ($cond1)
    #set( $br = "<br>" )
#end
#if ($cond2)
    some2
#elseif ($cond3)
    some3
#end
        ]]></code>
    </test-code>
</test-data>
