Coverage has been increased to 100% in ArrayTypeStyleCheck

This commit is contained in:
Ilja Dubinin 2015-07-09 23:25:37 +01:00 committed by Roman Ivanov
parent 86e805616d
commit c80e607ebb
2 changed files with 15 additions and 2 deletions

View File

@ -1095,7 +1095,6 @@
<regex><pattern>.*.checks.AbstractOptionCheck</pattern><branchRate>100</branchRate><lineRate>80</lineRate></regex>
<regex><pattern>.*.checks.AbstractTypeAwareCheck</pattern><branchRate>87</branchRate><lineRate>84</lineRate></regex>
<regex><pattern>.*.checks.AbstractTypeAwareCheck\$.*</pattern><branchRate>50</branchRate><lineRate>80</lineRate></regex>
<regex><pattern>.*.checks.ArrayTypeStyleCheck</pattern><branchRate>100</branchRate><lineRate>94</lineRate></regex>
<regex><pattern>.*.checks.AvoidEscapedUnicodeCharactersCheck</pattern><branchRate>97</branchRate><lineRate>98</lineRate></regex>
<regex><pattern>.*.checks.CheckUtils</pattern><branchRate>91</branchRate><lineRate>97</lineRate></regex>
<regex><pattern>.*.checks.ClassResolver</pattern><branchRate>85</branchRate><lineRate>93</lineRate></regex>

View File

@ -19,9 +19,14 @@
package com.puppycrawl.tools.checkstyle.checks;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertTrue;
import org.junit.Test;
import com.puppycrawl.tools.checkstyle.BaseCheckTestSupport;
import com.puppycrawl.tools.checkstyle.DefaultConfiguration;
import org.junit.Test;
import com.puppycrawl.tools.checkstyle.api.TokenTypes;
public class ArrayTypeStyleCheckTest
extends BaseCheckTestSupport {
@ -51,4 +56,13 @@ public class ArrayTypeStyleCheckTest
};
verify(checkConfig, getPath("InputArrayTypeStyle.java"), expected);
}
@Test
public void testGetAcceptableTockens() {
int[] expected = {TokenTypes.ARRAY_DECLARATOR };
ArrayTypeStyleCheck check = new ArrayTypeStyleCheck();
int[] actual = check.getAcceptableTokens();
assertTrue(actual.length == 1);
assertArrayEquals(expected, actual);
}
}