Skip to content

Commit

Permalink
More test fixups.
Browse files Browse the repository at this point in the history
  • Loading branch information
nedtwigg committed May 30, 2024
1 parent f8c3569 commit 6f92ad7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ void useJavaCommunityPluginFileConfig(String prettierVersion) throws IOException
assertFile("JavaTest.java").sameAsResource("npm/prettier/plugins/java-test.clean");
}

@ParameterizedTest(name = "{index}: suggestsMissingJavaCommunityPlugin with prettier {0}")
@Disabled
@ForLintRefactor
@ParameterizedTest(name = "{index}: suggestsMissingJavaCommunityPlugin with prettier {0}")
@ValueSource(strings = {PRETTIER_VERSION_2, PRETTIER_VERSION_3})
void suggestsMissingJavaCommunityPlugin(String prettierVersion) throws IOException {
setFile("build.gradle").toLines(
Expand Down Expand Up @@ -335,9 +335,9 @@ void usePhpAndJavaCommunityPlugin(String prettierVersion) throws IOException {
assertFile("JavaTest.java").sameAsResource("npm/prettier/plugins/java-test.clean");
}

@ParameterizedTest(name = "{index}: autodetectNpmrcFileConfig with prettier {0}")
@Disabled
@ForLintRefactor
@ParameterizedTest(name = "{index}: autodetectNpmrcFileConfig with prettier {0}")
@ValueSource(strings = {PRETTIER_VERSION_2, PRETTIER_VERSION_3})
void autodetectNpmrcFileConfig(String prettierVersion) throws IOException {
setFile(".npmrc").toLines(
Expand Down Expand Up @@ -413,6 +413,8 @@ void verifyCleanAndSpotlessWithNpmInstallCacheWorks(String prettierVersion) thro
}

@ParameterizedTest(name = "{index}: autodetectNpmrcFileConfig with prettier {0}")
@Disabled
@ForLintRefactor
@ValueSource(strings = {PRETTIER_VERSION_2, PRETTIER_VERSION_3})
void pickupNpmrcFileConfig(String prettierVersion) throws IOException {
setFile(".custom_npmrc").toLines(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2021-2023 DiffPlug
* Copyright 2021-2024 DiffPlug
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -33,11 +33,11 @@ class DiktatStepTest extends ResourceHarness {
@Test
void behavior() {
FormatterStep step = DiktatStep.create(TestProvisioner.mavenCentral());
StepHarnessWithFile.forStep(this, step).testResourceExceptionMsg("kotlin/diktat/Unsolvable.kt").isEqualTo("There are 2 unfixed errors:" +
System.lineSeparator() + "Error on line: 12, column: 9 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()");
StepHarnessWithFile.forStep(this, step).testResourceExceptionMsg("kotlin/diktat/Unsolvable.kt").isEqualTo("There are 2 unfixed errors:\n" +
"Error on line: 12, column: 9 cannot be fixed automatically\n" +
"[DEBUG_PRINT] use a dedicated logging library: found println()\n" +
"Error on line: 13, column: 9 cannot be fixed automatically\n" +
"[DEBUG_PRINT] use a dedicated logging library: found println()");
}

@Test
Expand All @@ -47,11 +47,11 @@ void behaviorConf() throws Exception {
FileSignature config = signAsList(conf);

FormatterStep step = DiktatStep.create("1.2.1", TestProvisioner.mavenCentral(), config);
StepHarnessWithFile.forStep(this, step).testResourceExceptionMsg("kotlin/diktat/Unsolvable.kt").isEqualTo("There are 2 unfixed errors:" +
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()");
StepHarnessWithFile.forStep(this, step).testResourceExceptionMsg("kotlin/diktat/Unsolvable.kt").isEqualTo("There are 2 unfixed errors:\n" +
"Error on line: 1, column: 1 cannot be fixed automatically\n" +
"[DEBUG_PRINT] use a dedicated logging library: found println()\n" +
"Error on line: 13, column: 9 cannot be fixed automatically\n" +
"[DEBUG_PRINT] use a dedicated logging library: found println()");
}

@Test
Expand Down

0 comments on commit 6f92ad7

Please sign in to comment.