"Main should return Unit" inspection: extend on JUnit test methods

So #KT-24509 Fixed
This commit is contained in:
Toshiaki Kameyama
2018-06-05 23:26:53 +03:00
committed by Mikhail Glukhikh
parent b5e3db1811
commit 69d2e8898a
15 changed files with 80 additions and 15 deletions
@@ -0,0 +1,10 @@
// PROBLEM: JUnit test should return Unit
// FIX: Add explicit Unit return type
// DISABLE-ERRORS
package org.junit
annotation class Test
class A {
@Test fun foo<caret>() = 1
}
@@ -0,0 +1,10 @@
// PROBLEM: JUnit test should return Unit
// FIX: Add explicit Unit return type
// DISABLE-ERRORS
package org.junit
annotation class Test
class A {
@Test fun foo<caret>(): Unit = 1
}
@@ -0,0 +1,9 @@
// FIX: Add explicit Unit return type
// DISABLE-ERRORS
package org.junit.jupiter.api
annotation class Test
class A {
@Test fun foo<caret>() = 1
}
@@ -0,0 +1,9 @@
// FIX: Add explicit Unit return type
// DISABLE-ERRORS
package org.junit.jupiter.api
annotation class Test
class A {
@Test fun foo<caret>(): Unit = 1
}
@@ -1,3 +1,4 @@
// PROBLEM: main should return Unit
// FIX: Add explicit Unit return type
// DISABLE-ERRORS
fun <caret>main(args: Array<String>) = 1
@@ -1,3 +1,4 @@
// PROBLEM: main should return Unit
// FIX: Add explicit Unit return type
// DISABLE-ERRORS
fun main(args: Array<String>): Unit = 1