Skip to content

Commit 113abd2

Browse files
committed
fixed integration tests
1 parent 779ff52 commit 113abd2

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
package org.cqfn.diktat.example.gradle.multiproject
22

33
/**
4-
* @return print.
4+
* @return something
55
*/
66
class Main {
77
/**
88
* foo a [member] to this group.
99
*
1010
*/
1111
fun foo() {
12-
println(";")
13-
println()
12+
bar(";")
13+
bar()
1414
}
1515
}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
package org.cqfn.diktat.example.gradle.multiproject
22
/**
3-
* @return print.
3+
* @return something
44
*/
55
class Main {
66
/**
77
* foo a [member] to this group.
88
*
99
*/
1010
fun foo() {
11-
println(";")
12-
println();
11+
bar(";")
12+
bar();
1313
}
1414
}

testlib/src/test/java/com/diffplug/spotless/kotlin/DiktatStepTest.java

+13-5
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,15 @@ void behavior() throws Exception {
3636
StepHarness.forStep(step)
3737
.testResourceException("kotlin/diktat/Unsolvable.kt", assertion -> {
3838
assertion.isInstanceOf(AssertionError.class);
39-
assertion.hasMessage("There are 2 unfixed errors:" +
39+
assertion.hasMessage("There are 4 unfixed errors:" +
4040
System.lineSeparator() + "Error on line: 1, column: 1 cannot be fixed automatically" +
4141
System.lineSeparator() + "[FILE_NAME_INCORRECT] file name is incorrect - it should end with .kt extension and be in PascalCase: testlib" +
4242
System.lineSeparator() + "Error on line: 1, column: 1 cannot be fixed automatically" +
43-
System.lineSeparator() + "[FILE_NAME_MATCH_CLASS] file name is incorrect - it should match with the class described in it if there is the only one class declared: testlib vs Unsolvable");
43+
System.lineSeparator() + "[FILE_NAME_MATCH_CLASS] file name is incorrect - it should match with the class described in it if there is the only one class declared: testlib vs Unsolvable" +
44+
System.lineSeparator() + "Error on line: 1, column: 1 cannot be fixed automatically" +
45+
System.lineSeparator() + "[DEBUG_PRINT] use a dedicated logging library: found println()" +
46+
System.lineSeparator() + "Error on line: 13, column: 9 cannot be fixed automatically" +
47+
System.lineSeparator() + "[DEBUG_PRINT] use a dedicated logging library: found println()");
4448
});
4549
}
4650

@@ -51,15 +55,19 @@ void behaviorConf() throws Exception {
5155
File conf = setFile(configPath).toResource("kotlin/diktat/diktat-analysis.yml");
5256
FileSignature config = signAsList(conf);
5357

54-
FormatterStep step = DiktatStep.create("1.0.1", TestProvisioner.mavenCentral(), Collections.emptyMap(), config);
58+
FormatterStep step = DiktatStep.create("1.2.0", TestProvisioner.mavenCentral(), config);
5559
StepHarness.forStep(step)
5660
.testResourceException("kotlin/diktat/Unsolvable.kt", assertion -> {
5761
assertion.isInstanceOf(AssertionError.class);
58-
assertion.hasMessage("There are 2 unfixed errors:" +
62+
assertion.hasMessage("There are 4 unfixed errors:" +
5963
System.lineSeparator() + "Error on line: 1, column: 1 cannot be fixed automatically" +
6064
System.lineSeparator() + "[FILE_NAME_INCORRECT] file name is incorrect - it should end with .kt extension and be in PascalCase: testlib" +
6165
System.lineSeparator() + "Error on line: 1, column: 1 cannot be fixed automatically" +
62-
System.lineSeparator() + "[FILE_NAME_MATCH_CLASS] file name is incorrect - it should match with the class described in it if there is the only one class declared: testlib vs Unsolvable");
66+
System.lineSeparator() + "[FILE_NAME_MATCH_CLASS] file name is incorrect - it should match with the class described in it if there is the only one class declared: testlib vs Unsolvable" +
67+
System.lineSeparator() + "Error on line: 1, column: 1 cannot be fixed automatically" +
68+
System.lineSeparator() + "[DEBUG_PRINT] use a dedicated logging library: found println()" +
69+
System.lineSeparator() + "Error on line: 13, column: 9 cannot be fixed automatically" +
70+
System.lineSeparator() + "[DEBUG_PRINT] use a dedicated logging library: found println()");
6371
});
6472
}
6573

0 commit comments

Comments
 (0)