From 6f92ad7bcf8d2bedf467fd6dec4e4482e52fbc7f Mon Sep 17 00:00:00 2001 From: Ned Twigg Date: Thu, 30 May 2024 12:32:51 -0700 Subject: [PATCH] More test fixups. --- .../spotless/PrettierIntegrationTest.java | 6 +++-- .../spotless/kotlin/DiktatStepTest.java | 22 +++++++++---------- 2 files changed, 15 insertions(+), 13 deletions(-) diff --git a/plugin-gradle/src/test/java/com/diffplug/gradle/spotless/PrettierIntegrationTest.java b/plugin-gradle/src/test/java/com/diffplug/gradle/spotless/PrettierIntegrationTest.java index f3950e0edc..e42c68bd43 100644 --- a/plugin-gradle/src/test/java/com/diffplug/gradle/spotless/PrettierIntegrationTest.java +++ b/plugin-gradle/src/test/java/com/diffplug/gradle/spotless/PrettierIntegrationTest.java @@ -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( @@ -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( @@ -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( diff --git a/testlib/src/test/java/com/diffplug/spotless/kotlin/DiktatStepTest.java b/testlib/src/test/java/com/diffplug/spotless/kotlin/DiktatStepTest.java index 9976fe0e84..62374d248c 100644 --- a/testlib/src/test/java/com/diffplug/spotless/kotlin/DiktatStepTest.java +++ b/testlib/src/test/java/com/diffplug/spotless/kotlin/DiktatStepTest.java @@ -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. @@ -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 @@ -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