Add test for PLSQL ignore literals

This commit is contained in:
Clément Fournier
2024-04-09 11:39:13 +02:00
parent 41c01356fc
commit f484c75c52
2 changed files with 1742 additions and 0 deletions

View File

@ -6,8 +6,10 @@ package net.sourceforge.pmd.lang.plsql.cpd;
import org.junit.jupiter.api.Test;
import net.sourceforge.pmd.cpd.CpdLanguageProperties;
import net.sourceforge.pmd.lang.plsql.PLSQLLanguageModule;
import net.sourceforge.pmd.lang.test.cpd.CpdTextComparisonTest;
import net.sourceforge.pmd.lang.test.cpd.LanguagePropertyConfig;
class PLSQLCpdLexerTest extends CpdTextComparisonTest {
@ -29,4 +31,15 @@ class PLSQLCpdLexerTest extends CpdTextComparisonTest {
void testTabWidth() {
doTest("tabWidth");
}
@Test
void anonymizeLiterals() {
doTest("sample-plsql", "_ignore-literals", ignoreLiterals());
}
LanguagePropertyConfig ignoreLiterals() {
return props -> {
props.setProperty(CpdLanguageProperties.CPD_ANONYMIZE_LITERALS, true);
};
}
}