Skip to content

Commit d64bbdb

Browse files
committed
Set Windows EOL for test.
1 parent 691ef10 commit d64bbdb

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

qulice-checkstyle/src/test/java/com/qulice/checkstyle/CheckstyleValidatorTest.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
import org.junit.jupiter.api.BeforeEach;
5151
import org.junit.jupiter.api.Disabled;
5252
import org.junit.jupiter.api.Test;
53+
import org.junit.jupiter.api.condition.EnabledOnOs;
54+
import org.junit.jupiter.api.condition.OS;
5355

5456
/**
5557
* Test case for {@link CheckstyleValidator} class.
@@ -467,15 +469,15 @@ void prohibitWindowsEndsOfLine() throws Exception {
467469
* @throws Exception If something wrong happens inside
468470
*/
469471
@Test
472+
@EnabledOnOs(OS.WINDOWS)
470473
void testWindowsEndsOfLineWithLinuxSources() throws Exception {
471474
final String file = "WindowsEolLinux.java";
472475
final Environment.Mock mock = new Environment.Mock();
473476
final File license = this.createLicense(mock, "\r\n", "Hello.", "World.");
474477
final Environment env = this.configureEnvironment(mock, license, file);
475-
final Collection<Violation> results =
476-
new CheckstyleValidator(env).validate(
477-
env.files(file)
478-
);
478+
final Collection<Violation> results = new CheckstyleValidator(env).validate(
479+
env.files(file)
480+
);
479481
final String message = "Line does not match expected header line of ' *'";
480482
final String name = "HeaderCheck";
481483
MatcherAssert.assertThat(
@@ -905,8 +907,7 @@ private File createLicense(final Environment env, final String eol, final String
905907
throws IOException {
906908
return this.rule.savePackageInfo(
907909
new File(env.basedir(), CheckstyleValidatorTest.DIRECTORY)
908-
).withLines(lines)
909-
.withEol(eol).file();
910+
).withLines(lines).withEol(eol).file();
910911
}
911912

912913
/**
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
/*
2-
* Hello.
3-
*/
4-
package foo;
5-
/**
6-
* Simple class.
7-
* @since 1.0
8-
*/
9-
public class WindowsEol { }
10-
1+
/*
2+
* Hello.
3+
*/
4+
package foo;
5+
/**
6+
* Simple class.
7+
* @since 1.0
8+
*/
9+
public class WindowsEol { }
10+

0 commit comments

Comments
 (0)