Add test for inspections suppression
This commit is contained in:
committed by
Nikolay Krasko
parent
aff83087a3
commit
8196621be5
@@ -0,0 +1,9 @@
|
||||
// "Suppress 'IfNullToElvis' for fun foo" "true"
|
||||
|
||||
fun foo(p: List<String?>, b: Boolean) {
|
||||
var v = p[0]
|
||||
<caret>if (v == null) return
|
||||
if (b) v = null
|
||||
}
|
||||
|
||||
// TOOL: org.jetbrains.kotlin.idea.intentions.IfNullToElvisInspection
|
||||
@@ -0,0 +1,10 @@
|
||||
// "Suppress 'IfNullToElvis' for fun foo" "true"
|
||||
|
||||
@Suppress("IfNullToElvis")
|
||||
fun foo(p: List<String?>, b: Boolean) {
|
||||
var v = p[0]
|
||||
<caret>if (v == null) return
|
||||
if (b) v = null
|
||||
}
|
||||
|
||||
// TOOL: org.jetbrains.kotlin.idea.intentions.IfNullToElvisInspection
|
||||
@@ -0,0 +1,5 @@
|
||||
// "Suppress 'KotlinUnusedImport' for file ${file}" "true"
|
||||
|
||||
import<caret> java.io.*
|
||||
|
||||
// TOOL: org.jetbrains.kotlin.idea.inspections.KotlinUnusedImportInspection
|
||||
@@ -0,0 +1,7 @@
|
||||
// "Suppress 'KotlinUnusedImport' for file ${file}" "true"
|
||||
|
||||
@file:Suppress("KotlinUnusedImport")
|
||||
|
||||
import java.io.*
|
||||
|
||||
// TOOL: org.jetbrains.kotlin.idea.inspections.KotlinUnusedImportInspection
|
||||
Reference in New Issue
Block a user