diff --git a/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/chapter5/OverloadingArgumentsFunctionWarnTest.kt b/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/chapter5/OverloadingArgumentsFunctionWarnTest.kt index eac4209fa8..3e89a305d7 100644 --- a/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/chapter5/OverloadingArgumentsFunctionWarnTest.kt +++ b/diktat-rules/src/test/kotlin/org/cqfn/diktat/ruleset/chapter5/OverloadingArgumentsFunctionWarnTest.kt @@ -61,6 +61,36 @@ class OverloadingArgumentsFunctionWarnTest : LintTestBase(::OverloadingArguments ) } + @Test + @Tag(WarningNames.WRONG_OVERLOADING_FUNCTION_ARGUMENTS) + fun `functions with override modifiers`() { + lintMethod( + """ + |fun list(projectCoordinates: ProjectCoordinates): Flux = list() + | .filter { it.projectCoordinates == projectCoordinates } + | + |override fun list(): Flux = newFileStorage.list() + | .map { fileDto -> + | FileKey( + | projectCoordinates = fileDto.projectCoordinates, + | name = fileDto.name, + | uploadedMillis = fileDto.uploadedTime.toInstant(TimeZone.UTC).toEpochMilliseconds() + | ) + | } + """.trimMargin(), + ) + } + @Test + @Tag(WarningNames.WRONG_OVERLOADING_FUNCTION_ARGUMENTS) + fun `functions with override modifiers simple`() { + lintMethod( + """ + |fun foo(a: Int) {} + |override fun foo() {} + """.trimMargin() + ) + } + @Test @Tag(WarningNames.WRONG_OVERLOADING_FUNCTION_ARGUMENTS) fun `functions with unordered, but same modifiers`() {