[modelica] Add rule test for ClassStartNameEqualsEndName

This commit is contained in:
Andreas Dangel
2019-12-17 12:22:54 +01:00
parent 909dd935d1
commit 7bb987fcf4
2 changed files with 36 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
/**
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
*/
package net.sourceforge.pmd.lang.modelica.rule.bestpractices;
import net.sourceforge.pmd.testframework.PmdRuleTst;
public class ClassStartNameEqualsEndNameTest extends PmdRuleTst {
// no additional unit tests
}

View File

@@ -0,0 +1,25 @@
<?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>Valid example</description>
<expected-problems>0</expected-problems>
<code><![CDATA[
package Test
end Test;
]]></code>
<source-type>modelica</source-type>
</test-code>
<test-code>
<description>Invalid example</description>
<expected-problems>1</expected-problems>
<expected-linenumbers>1</expected-linenumbers>
<code><![CDATA[
package Test
end OtherName;
]]></code>
<source-type>modelica</source-type>
</test-code>
</test-data>