diff --git a/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/chapter3/FileStructureRuleTest.kt b/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/chapter3/FileStructureRuleTest.kt index 34deca3be6..dcc195cf3a 100644 --- a/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/chapter3/FileStructureRuleTest.kt +++ b/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/chapter3/FileStructureRuleTest.kt @@ -80,10 +80,10 @@ class FileStructureRuleTest : LintTestBase(::FileStructureRule) { | |class Example { |val x: Test = null - |val x: Foo = null + |val y: Foo = null |} """.trimMargin(), - LintError(3, 1, ruleId, "${FILE_UNORDERED_IMPORTS.warnText()} import org.cqfn.diktat.example.Foo...", true) + LintError(3, 1, ruleId, "${FILE_UNORDERED_IMPORTS.warnText()} import org.cqfn.diktat.Foo...", true) ) } diff --git a/diktat-rules/src/test/resources/test/paragraph3/file_structure/BlankLinesBetweenBlocksExpected.kt b/diktat-rules/src/test/resources/test/paragraph3/file_structure/BlankLinesBetweenBlocksExpected.kt index f559d2c2e6..0c077cfe7c 100644 --- a/diktat-rules/src/test/resources/test/paragraph3/file_structure/BlankLinesBetweenBlocksExpected.kt +++ b/diktat-rules/src/test/resources/test/paragraph3/file_structure/BlankLinesBetweenBlocksExpected.kt @@ -6,6 +6,8 @@ package org.cqfn.diktat.example -import org.cqfn.diktat.example.Foo +import org.cqfn.diktat.Foo -class Example +class Example { + val y: Foo = Foo() +} diff --git a/diktat-rules/src/test/resources/test/paragraph3/file_structure/DefaultPackageWithImportsExpected.kt b/diktat-rules/src/test/resources/test/paragraph3/file_structure/DefaultPackageWithImportsExpected.kt index cfd23200d8..1be264da98 100644 --- a/diktat-rules/src/test/resources/test/paragraph3/file_structure/DefaultPackageWithImportsExpected.kt +++ b/diktat-rules/src/test/resources/test/paragraph3/file_structure/DefaultPackageWithImportsExpected.kt @@ -10,4 +10,7 @@ import foo.Bar /** * KDoc */ -class Example \ No newline at end of file +class Example{ + val x: Bar = Bar() + val y: Baz = Baz() +} \ No newline at end of file diff --git a/diktat-rules/src/test/resources/test/paragraph3/file_structure/DefaultPackageWithImportsTest.kt b/diktat-rules/src/test/resources/test/paragraph3/file_structure/DefaultPackageWithImportsTest.kt index c0638499d4..fb6c94388c 100644 --- a/diktat-rules/src/test/resources/test/paragraph3/file_structure/DefaultPackageWithImportsTest.kt +++ b/diktat-rules/src/test/resources/test/paragraph3/file_structure/DefaultPackageWithImportsTest.kt @@ -8,4 +8,7 @@ import baz.Baz /** * KDoc */ -class Example \ No newline at end of file +class Example{ + val x: Bar = Bar() + val y: Baz = Baz() +} \ No newline at end of file diff --git a/diktat-rules/src/test/resources/test/paragraph3/file_structure/MissingBlankLinesBetweenBlocksTest.kt b/diktat-rules/src/test/resources/test/paragraph3/file_structure/MissingBlankLinesBetweenBlocksTest.kt index 312d987741..5e7ada7c4f 100644 --- a/diktat-rules/src/test/resources/test/paragraph3/file_structure/MissingBlankLinesBetweenBlocksTest.kt +++ b/diktat-rules/src/test/resources/test/paragraph3/file_structure/MissingBlankLinesBetweenBlocksTest.kt @@ -3,5 +3,7 @@ */ @file:JvmName("Foo") package org.cqfn.diktat.example -import org.cqfn.diktat.example.Foo -class Example +import org.cqfn.diktat.Foo +class Example { + val y: Foo = Foo() +} diff --git a/diktat-rules/src/test/resources/test/paragraph3/file_structure/RedundantBlankLinesBetweenBlocksTest.kt b/diktat-rules/src/test/resources/test/paragraph3/file_structure/RedundantBlankLinesBetweenBlocksTest.kt index 5bc6dbf9b4..19874b7c7a 100644 --- a/diktat-rules/src/test/resources/test/paragraph3/file_structure/RedundantBlankLinesBetweenBlocksTest.kt +++ b/diktat-rules/src/test/resources/test/paragraph3/file_structure/RedundantBlankLinesBetweenBlocksTest.kt @@ -11,7 +11,7 @@ package org.cqfn.diktat.example -import org.cqfn.diktat.example.Foo +import org.cqfn.diktat.Foo @@ -19,4 +19,6 @@ import org.cqfn.diktat.example.Foo -class Example +class Example { + val y: Foo = Foo() +} diff --git a/diktat-rules/src/test/resources/test/paragraph3/file_structure/ReorderingImportsExpected.kt b/diktat-rules/src/test/resources/test/paragraph3/file_structure/ReorderingImportsExpected.kt index 1d620c78fa..eebc1e9cd2 100644 --- a/diktat-rules/src/test/resources/test/paragraph3/file_structure/ReorderingImportsExpected.kt +++ b/diktat-rules/src/test/resources/test/paragraph3/file_structure/ReorderingImportsExpected.kt @@ -5,4 +5,8 @@ import org.cqfn.diktat.example.Bar import org.cqfn.diktat.example.Foo import org.junit.jupiter.api.Test -class Example +class Example { + val x: Test = Test() + val y: Foo = Foo() + val z: Bar = Bar() +} diff --git a/diktat-rules/src/test/resources/test/paragraph3/file_structure/ReorderingImportsRecommendedExpected.kt b/diktat-rules/src/test/resources/test/paragraph3/file_structure/ReorderingImportsRecommendedExpected.kt index 0b0f1391a0..90bc8178e7 100644 --- a/diktat-rules/src/test/resources/test/paragraph3/file_structure/ReorderingImportsRecommendedExpected.kt +++ b/diktat-rules/src/test/resources/test/paragraph3/file_structure/ReorderingImportsRecommendedExpected.kt @@ -21,4 +21,12 @@ import java.nio.charset.Charset import kotlin.system.exitProcess -class Example +class Example { + val x = setOf(CaseFormat(), Detekt(), Assertions(), Logger(), Bean(), IOException(), URL(), Charset(), ObjectMapper()) + + fun Foo() { + while (true) { + exitProcess(1) + } + } +} diff --git a/diktat-rules/src/test/resources/test/paragraph3/file_structure/ReorderingImportsRecommendedTest.kt b/diktat-rules/src/test/resources/test/paragraph3/file_structure/ReorderingImportsRecommendedTest.kt index c364456b95..e016cbcf70 100644 --- a/diktat-rules/src/test/resources/test/paragraph3/file_structure/ReorderingImportsRecommendedTest.kt +++ b/diktat-rules/src/test/resources/test/paragraph3/file_structure/ReorderingImportsRecommendedTest.kt @@ -17,4 +17,12 @@ import java.nio.charset.Charset import io.gitlab.arturbosch.detekt.Detekt import org.slf4j.Logger -class Example +class Example { + val x = setOf(CaseFormat(), Detekt(), Assertions(), Logger(), Bean(), IOException(), URL(), Charset(), ObjectMapper()) + + fun Foo() { + while (true) { + exitProcess(1) + } + } +} diff --git a/diktat-rules/src/test/resources/test/paragraph3/file_structure/ReorderingImportsTest.kt b/diktat-rules/src/test/resources/test/paragraph3/file_structure/ReorderingImportsTest.kt index 98bd80ea87..ff79fcbcdc 100644 --- a/diktat-rules/src/test/resources/test/paragraph3/file_structure/ReorderingImportsTest.kt +++ b/diktat-rules/src/test/resources/test/paragraph3/file_structure/ReorderingImportsTest.kt @@ -4,4 +4,8 @@ import org.junit.jupiter.api.Test import org.cqfn.diktat.example.Foo // lorem ipsum import org.cqfn.diktat.example.Bar -class Example +class Example { + val x: Test = Test() + val y: Foo = Foo() + val z: Bar = Bar() +}