From 82b54af5336a9729b86914e763e17e8f91fa9b83 Mon Sep 17 00:00:00 2001 From: Nariman Abdullin Date: Fri, 27 Oct 2023 13:35:20 +0300 Subject: [PATCH] diktatFix --- .../kotlin/com/saveourtool/diktat/util/FixTestBase.kt | 2 +- .../test/framework/processing/TestComparatorUnit.kt | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/diktat-rules/src/test/kotlin/com/saveourtool/diktat/util/FixTestBase.kt b/diktat-rules/src/test/kotlin/com/saveourtool/diktat/util/FixTestBase.kt index 483402f033..eb07b4e201 100644 --- a/diktat-rules/src/test/kotlin/com/saveourtool/diktat/util/FixTestBase.kt +++ b/diktat-rules/src/test/kotlin/com/saveourtool/diktat/util/FixTestBase.kt @@ -44,7 +44,7 @@ open class FixTestBase( * @param expectedPath path to file with expected result, relative to [resourceFilePath] * @param testPath path to file with code that will be transformed by formatter, relative to [resourceFilePath] * @param overrideRulesConfigList optional override to [defaultRulesConfigList] - * @param overrideResourceReader [ResourceReader] to read resource content. + * @param overrideResourceReader function to override [ResourceReader] to read resource content. * @see fixAndCompareContent */ protected fun fixAndCompare( diff --git a/diktat-test-framework/src/main/kotlin/com/saveourtool/diktat/test/framework/processing/TestComparatorUnit.kt b/diktat-test-framework/src/main/kotlin/com/saveourtool/diktat/test/framework/processing/TestComparatorUnit.kt index 78a619ffc0..a598538268 100644 --- a/diktat-test-framework/src/main/kotlin/com/saveourtool/diktat/test/framework/processing/TestComparatorUnit.kt +++ b/diktat-test-framework/src/main/kotlin/com/saveourtool/diktat/test/framework/processing/TestComparatorUnit.kt @@ -23,7 +23,11 @@ class TestComparatorUnit( constructor( resourceFilePath: String, function: (testFile: Path) -> String, - ): this(resourceReader = ResourceReader.default.withPrefix(resourceFilePath), function = function) + ) : this( + resourceReader = ResourceReader.default.withPrefix(resourceFilePath), + function = function, + ) + /** * @param expectedResult the name of the resource which has the expected * content. The trailing newline, if any, **won't be read** as a separate @@ -32,7 +36,7 @@ class TestComparatorUnit( * `newlineAtEnd` is `true`), then the file should end with **two** * consecutive linebreaks. * @param testFileStr the name of the resource which has the original content. - * @param overrideResourceReader [ResourceReader] to read resource content + * @param overrideResourceReader function to override [ResourceReader] to read resource content * @return the result of file comparison by their content. * @see compareFilesFromFileSystem */