Added tests for all code samples from KT-60523, except 2.3.
Test for 2.3 sample must be added in the context of KT-61792.
This commit is contained in:
committed by
Space Team
parent
2dae7ce6c1
commit
eab6e9bb36
+42
@@ -0,0 +1,42 @@
|
||||
// !LANGUAGE: +MultiPlatformProjects
|
||||
// IGNORE_BACKEND_K1: JVM, JVM_IR, JS, JS_IR, JS_IR_ES6, NATIVE, WASM
|
||||
// ISSUE: KT-60523
|
||||
|
||||
// MODULE: common
|
||||
// TARGET_PLATFORM: Common
|
||||
// FILE: common.kt
|
||||
|
||||
expect fun warn(): String
|
||||
expect fun error(): String
|
||||
expect fun hidden(): String
|
||||
|
||||
fun common(): String {
|
||||
// no deprecation warning
|
||||
if (warn() != "OK") return "Warn fail"
|
||||
// no deprecation error
|
||||
if (error() != "OK") return "Error fail"
|
||||
// no compilation error
|
||||
if (hidden() != "OK") return "Hidden fail"
|
||||
return "OK"
|
||||
}
|
||||
|
||||
|
||||
// MODULE: lib()()(common)
|
||||
// FILE: lib.kt
|
||||
|
||||
@Deprecated("", level = DeprecationLevel.WARNING)
|
||||
actual fun warn(): String = "OK"
|
||||
|
||||
@Deprecated("", level = DeprecationLevel.ERROR)
|
||||
actual fun error(): String = "OK"
|
||||
|
||||
@Deprecated("", level = DeprecationLevel.HIDDEN)
|
||||
actual fun hidden(): String = "OK"
|
||||
|
||||
|
||||
// MODULE: main(lib)
|
||||
// FILE: main.kt
|
||||
|
||||
fun box(): String {
|
||||
return common()
|
||||
}
|
||||
Reference in New Issue
Block a user