Coverage has been increased to 100% in UpperEllCheck

This commit is contained in:
Ilja Dubinin 2015-07-09 23:56:45 +01:00 committed by Roman Ivanov
parent 10521b417e
commit fa9ece71f4
2 changed files with 16 additions and 4 deletions

View File

@ -1109,7 +1109,6 @@
<regex><pattern>.*.checks.TranslationCheck</pattern><branchRate>81</branchRate><lineRate>83</lineRate></regex>
<regex><pattern>.*.checks.UncommentedMainCheck</pattern><branchRate>83</branchRate><lineRate>88</lineRate></regex>
<regex><pattern>.*.checks.UniquePropertiesCheck\$.*</pattern><branchRate>75</branchRate><lineRate>90</lineRate></regex>
<regex><pattern>.*.checks.UpperEllCheck</pattern><branchRate>100</branchRate><lineRate>83</lineRate></regex>
<regex><pattern>.*.checks.annotation.AnnotationLocationCheck</pattern><branchRate>75</branchRate><lineRate>78</lineRate></regex>

View File

@ -19,11 +19,15 @@
package com.puppycrawl.tools.checkstyle.checks;
import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
import static com.puppycrawl.tools.checkstyle.checks.UpperEllCheck.MSG_KEY;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import static com.puppycrawl.tools.checkstyle.checks.UpperEllCheck.MSG_KEY;
import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
public class UpperEllCheckTest
extends BaseCheckTestSupport {
@ -37,4 +41,13 @@ public class UpperEllCheckTest
};
verify(checkConfig, getPath("InputSemantic.java"), expected);
}
@Test
public void testAcceptableTockens() {
int[] expected = {TokenTypes.NUM_LONG };
UpperEllCheck check = new UpperEllCheck();
int[] actual = check.getAcceptableTokens();
assertTrue(actual.length == 1);
assertArrayEquals(expected, actual);
}
}