make IG test light

This commit is contained in:
Bas Leijdekkers
2017-09-20 23:02:58 +02:00
parent 3db80a01df
commit cde729765c
4 changed files with 36 additions and 32 deletions
@@ -29,7 +29,7 @@ public class SwitchStatementsWithoutDefault
break;
}
switch(bar)
<warning descr="'switch' statement without 'default' branch">switch</warning>(bar)
{
case 3:
case 4:
@@ -52,13 +52,13 @@ public class SwitchStatementsWithoutDefault
case baz:
break;
}
switch(var)
<warning descr="'switch' statement without 'default' branch">switch</warning>(var)
{
case bar:
case baz:
break;
}
switch (var)
switch (var)<EOLError descr="'{' expected"></EOLError>
}
enum MyEnum {
@@ -1,18 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<problems>
<problem>
<file>SwitchStatementsWithoutDefault.java</file>
<line>32</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">'switch' statement without 'default' branch</problem_class>
<description>&lt;code&gt;switch&lt;/code&gt; statement without 'default' branch #loc</description>
</problem>
<problem>
<file>SwitchStatementsWithoutDefault.java</file>
<line>55</line>
<problem_class severity="WARNING" attribute_key="WARNING_ATTRIBUTES">'switch' statement without 'default' branch</problem_class>
<description>&lt;code&gt;switch&lt;/code&gt; statement without 'default' branch #loc</description>
</problem>
</problems>
@@ -1,11 +0,0 @@
package com.siyeh.ig.controlflow;
import com.siyeh.ig.IGInspectionTestCase;
public class SwitchStatementWithoutDefaultInspectionTest extends IGInspectionTestCase {
public void test() {
doTest("com/siyeh/igtest/controlflow/switch_statements_without_default",
new SwitchStatementsWithoutDefaultInspection());
}
}
@@ -0,0 +1,33 @@
/*
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package com.siyeh.ig.controlflow;
import com.intellij.codeInspection.InspectionProfileEntry;
import com.siyeh.ig.LightInspectionTestCase;
import org.jetbrains.annotations.Nullable;
public class SwitchStatementsWithoutDefaultInspectionTest extends LightInspectionTestCase {
public void testSwitchStatementsWithoutDefault() {
doTest();
}
@Nullable
@Override
protected InspectionProfileEntry getInspection() {
return new SwitchStatementsWithoutDefaultInspection();
}
}