Skip to content

Commit

Permalink
fixed integration tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nulls committed Jun 24, 2022
1 parent 779ff52 commit 113abd2
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 11 deletions.
6 changes: 3 additions & 3 deletions testlib/src/main/resources/kotlin/diktat/main.clean
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package org.cqfn.diktat.example.gradle.multiproject

/**
* @return print.
* @return something
*/
class Main {
/**
* foo a [member] to this group.
*
*/
fun foo() {
println(";")
println()
bar(";")
bar()
}
}
6 changes: 3 additions & 3 deletions testlib/src/main/resources/kotlin/diktat/main.dirty
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
package org.cqfn.diktat.example.gradle.multiproject
/**
* @return print.
* @return something
*/
class Main {
/**
* foo a [member] to this group.
*
*/
fun foo() {
println(";")
println();
bar(";")
bar();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,15 @@ void behavior() throws Exception {
StepHarness.forStep(step)
.testResourceException("kotlin/diktat/Unsolvable.kt", assertion -> {
assertion.isInstanceOf(AssertionError.class);
assertion.hasMessage("There are 2 unfixed errors:" +
assertion.hasMessage("There are 4 unfixed errors:" +
System.lineSeparator() + "Error on line: 1, column: 1 cannot be fixed automatically" +
System.lineSeparator() + "[FILE_NAME_INCORRECT] file name is incorrect - it should end with .kt extension and be in PascalCase: testlib" +
System.lineSeparator() + "Error on line: 1, column: 1 cannot be fixed automatically" +
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");
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" +
System.lineSeparator() + "Error on line: 1, column: 1 cannot be fixed automatically" +
System.lineSeparator() + "[DEBUG_PRINT] use a dedicated logging library: found println()" +
System.lineSeparator() + "Error on line: 13, column: 9 cannot be fixed automatically" +
System.lineSeparator() + "[DEBUG_PRINT] use a dedicated logging library: found println()");
});
}

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

FormatterStep step = DiktatStep.create("1.0.1", TestProvisioner.mavenCentral(), Collections.emptyMap(), config);
FormatterStep step = DiktatStep.create("1.2.0", TestProvisioner.mavenCentral(), config);
StepHarness.forStep(step)
.testResourceException("kotlin/diktat/Unsolvable.kt", assertion -> {
assertion.isInstanceOf(AssertionError.class);
assertion.hasMessage("There are 2 unfixed errors:" +
assertion.hasMessage("There are 4 unfixed errors:" +
System.lineSeparator() + "Error on line: 1, column: 1 cannot be fixed automatically" +
System.lineSeparator() + "[FILE_NAME_INCORRECT] file name is incorrect - it should end with .kt extension and be in PascalCase: testlib" +
System.lineSeparator() + "Error on line: 1, column: 1 cannot be fixed automatically" +
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");
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" +
System.lineSeparator() + "Error on line: 1, column: 1 cannot be fixed automatically" +
System.lineSeparator() + "[DEBUG_PRINT] use a dedicated logging library: found println()" +
System.lineSeparator() + "Error on line: 13, column: 9 cannot be fixed automatically" +
System.lineSeparator() + "[DEBUG_PRINT] use a dedicated logging library: found println()");
});
}

Expand Down

0 comments on commit 113abd2

Please sign in to comment.