Merge branch 'pr-1743'

This commit is contained in:
Andreas Dangel
2019-03-30 18:02:45 +01:00
4 changed files with 24 additions and 6 deletions

View File

@ -9,8 +9,10 @@ import static org.junit.Assert.assertTrue;
import java.util.Set;
import org.junit.Assert;
import org.junit.Test;
import net.sourceforge.pmd.Rule;
import net.sourceforge.pmd.testframework.PmdRuleTst;
public class AvoidDuplicateLiteralsTest extends PmdRuleTst {
@ -50,4 +52,13 @@ public class AvoidDuplicateLiteralsTest extends PmdRuleTst {
assertTrue(res.contains("b"));
assertTrue(res.contains("\\"));
}
@Test
public void testSeparatorPropertyWarning() throws Exception {
AvoidDuplicateLiteralsRule rule = new AvoidDuplicateLiteralsRule();
Assert.assertFalse(rule.isPropertyOverridden(AvoidDuplicateLiteralsRule.SEPARATOR_DESCRIPTOR));
Rule copy = rule.deepCopy();
Assert.assertFalse(copy.isPropertyOverridden(AvoidDuplicateLiteralsRule.SEPARATOR_DESCRIPTOR));
}
}