forked from phoedos/pmd
Update UnnecessaryBlockTest.java
This commit is contained in:
parent
e5247d1703
commit
a015835756
@ -1,11 +1,32 @@
|
||||
/**
|
||||
* BSD-style license; for more info see http://pmd.sourceforge.net/license.html
|
||||
*/
|
||||
|
||||
package net.sourceforge.pmd.lang.ecmascript.rule.codestyle;
|
||||
|
||||
import net.sourceforge.pmd.testframework.PmdRuleTst;
|
||||
|
||||
class UnnecessaryBlockTest extends PmdRuleTst {
|
||||
// no additional unit tests
|
||||
public class UnnecessaryBlockTest extends PmdRuleTst {
|
||||
@Override
|
||||
public void setUp() {
|
||||
// Set up any required configurations or resources before running the tests
|
||||
}
|
||||
|
||||
|
||||
public void testUnnecessaryBlockInImportStatement() {
|
||||
String code = "import { foo } from 'bar';\n" +
|
||||
"{\n" +
|
||||
" // Unnecessary block\n" +
|
||||
"}\n";
|
||||
|
||||
// Assert that the PMD rule does not flag the unnecessary block within import statement
|
||||
addSourceCodeTest(code, 0);
|
||||
}
|
||||
|
||||
public void testUnnecessaryBlockInDestructuringAssignment() {
|
||||
String code = "const { a, b } = obj;\n" +
|
||||
"{\n" +
|
||||
" // Unnecessary block\n" +
|
||||
"}\n";
|
||||
|
||||
// Assert that the PMD rule does not flag the unnecessary block within destructuring assignment
|
||||
addSourceCodeTest(code, 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user