Skip to content

Commit

Permalink
Issue checkstyle#4080: Split and Organize Checkstyle inputs by Test f…
Browse files Browse the repository at this point in the history
…or SingleSpaceSeparator
  • Loading branch information
wate123 authored and timurt committed May 6, 2017
1 parent c083d5d commit 27725fc
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
Expand Up @@ -34,13 +34,15 @@ public class SingleSpaceSeparatorCheckTest extends BaseCheckTestSupport {
@Override
protected String getPath(String filename) throws IOException {
return super.getPath("checks" + File.separator
+ "whitespace" + File.separator + filename);
+ "whitespace" + File.separator
+ "singlespaceseparator" + File.separator
+ filename);
}

@Test
public void testNoSpaceErrors() throws Exception {
final DefaultConfiguration checkConfig = createCheckConfig(SingleSpaceSeparatorCheck.class);
verify(checkConfig, getPath("InputSingleSpaceNoErrors.java"),
verify(checkConfig, getPath("InputSingleSpaceSeparatorNoErrors.java"),
CommonUtils.EMPTY_STRING_ARRAY);
}

Expand Down Expand Up @@ -99,7 +101,7 @@ public void testSpaceErrorsAroundComments() throws Exception {
"14:7: " + getCheckMessage(MSG_KEY),
};

verify(checkConfig, getPath("InputSingleSpaceComments.java"), expected);
verify(checkConfig, getPath("InputSingleSpaceSeparatorComments.java"), expected);
}

@Test
Expand All @@ -109,6 +111,6 @@ public void testSpaceErrorsIfCommentsIgnored() throws Exception {
"13:13: " + getCheckMessage(MSG_KEY),
};

verify(checkConfig, getPath("InputSingleSpaceComments.java"), expected);
verify(checkConfig, getPath("InputSingleSpaceSeparatorComments.java"), expected);
}
}
@@ -1,4 +1,4 @@
package com.puppycrawl. tools.checkstyle.checks.whitespace;
package com.puppycrawl. tools.checkstyle.checks.whitespace.singlespaceseparator;

import java.util.List;
import java.util.Vector;
Expand Down
@@ -1,6 +1,6 @@
package com.puppycrawl.tools.checkstyle.checks.whitespace;
package com.puppycrawl.tools.checkstyle.checks.whitespace.singlespaceseparator;

public class InputSingleSpaceComments {
public class InputSingleSpaceSeparatorComments {
/* always correct */ int i = 0;
int /* wrong if X is enabled */ j = 0;
int k; // Multiple whitespaces before comment
Expand Down
@@ -1,9 +1,9 @@
package com.puppycrawl.tools.checkstyle.checks.whitespace;
package com.puppycrawl.tools.checkstyle.checks.whitespace.singlespaceseparator;

import java.util.ArrayList;
import java.util.List;

public class InputSingleSpaceNoErrors {
public class InputSingleSpaceSeparatorNoErrors {

int count; //long indentation - OK
String text = " "; // OK
Expand Down

0 comments on commit 27725fc

Please sign in to comment.