[Test] Convert IGNORE: NATIVE directives in box tests from D to I
^KT-59057 Merge-request: KT-MR-10748 Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
This commit is contained in:
committed by
Space Team
parent
919d6401f7
commit
a036e41809
+4
-7
@@ -1,6 +1,3 @@
|
||||
// IGNORE_BACKEND: WASM
|
||||
// WASM_MUTE_REASON: IGNORED_IN_JS
|
||||
// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6, NATIVE
|
||||
// WITH_REFLECT
|
||||
// WITH_STDLIB
|
||||
// WORKS_WHEN_VALUE_CLASS
|
||||
@@ -16,14 +13,14 @@ fun box(): String {
|
||||
val b = Z("b")
|
||||
|
||||
val equals = Z::equals
|
||||
assertTrue(equals.call(a, a))
|
||||
assertFalse(equals.call(a, b))
|
||||
assertTrue(equals.invoke(a, a))
|
||||
assertFalse(equals.invoke(a, b))
|
||||
|
||||
val hashCode = Z::hashCode
|
||||
assertEquals(a.s.hashCode(), hashCode.call(a))
|
||||
assertEquals(a.s.hashCode(), hashCode.invoke(a))
|
||||
|
||||
val toString = Z::toString
|
||||
assertEquals("Z(s=${a.s})", toString.call(a))
|
||||
assertEquals("Z(s=${a.s})", toString.invoke(a))
|
||||
|
||||
return "OK"
|
||||
}
|
||||
Vendored
+4
-7
@@ -1,6 +1,3 @@
|
||||
// IGNORE_BACKEND: WASM
|
||||
// WASM_MUTE_REASON: IGNORED_IN_JS
|
||||
// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6, NATIVE
|
||||
// WITH_REFLECT
|
||||
// WITH_STDLIB
|
||||
// WORKS_WHEN_VALUE_CLASS
|
||||
@@ -16,14 +13,14 @@ fun box(): String {
|
||||
val b = Z("b")
|
||||
|
||||
val equals = Z<String>::equals
|
||||
assertTrue(equals.call(a, a))
|
||||
assertFalse(equals.call(a, b))
|
||||
assertTrue(equals.invoke(a, a))
|
||||
assertFalse(equals.invoke(a, b))
|
||||
|
||||
val hashCode = Z<String>::hashCode
|
||||
assertEquals(a.s.hashCode(), hashCode.call(a))
|
||||
assertEquals(a.s.hashCode(), hashCode.invoke(a))
|
||||
|
||||
val toString = Z<String>::toString
|
||||
assertEquals("Z(s=${a.s})", toString.call(a))
|
||||
assertEquals("Z(s=${a.s})", toString.invoke(a))
|
||||
|
||||
return "OK"
|
||||
}
|
||||
+8
-10
@@ -1,7 +1,3 @@
|
||||
// IGNORE_BACKEND: WASM
|
||||
// WASM_MUTE_REASON: IGNORED_IN_JS
|
||||
// IGNORE_BACKEND: JS, JS_IR, NATIVE
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
// WITH_STDLIB
|
||||
// WORKS_WHEN_VALUE_CLASS
|
||||
// LANGUAGE: +ValueClasses
|
||||
@@ -11,14 +7,16 @@ class CharacterLiteral(private val prefix: NamelessString, private val s: Namele
|
||||
}
|
||||
|
||||
OPTIONAL_JVM_INLINE_ANNOTATION
|
||||
value class NamelessString(val b: ByteArray) {
|
||||
override fun toString(): String = String(b)
|
||||
value class NamelessString(val b: CharArray) {
|
||||
override fun toString(): String = b.concatToString()
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val ns1 = NamelessString("abc".toByteArray())
|
||||
val ns2 = NamelessString("def".toByteArray())
|
||||
val abcCharArray = "abc".toCharArray()
|
||||
if (abcCharArray.toString() == "abc") return "Prerequisite failed: value of abcCharArray.toString() is intended to be not equal to 'abc'"
|
||||
val ns1 = NamelessString(abcCharArray)
|
||||
val ns2 = NamelessString("def".toCharArray())
|
||||
val cl = CharacterLiteral(ns1, ns2)
|
||||
if (cl.toString() != "abc'def'") return throw AssertionError(cl.toString())
|
||||
if (cl.toString() != "abc'def'") return cl.toString()
|
||||
return "OK"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
// WITH_STDLIB
|
||||
// IGNORE_BACKEND: JS, JS_IR, JS_IR_ES6, WASM, NATIVE
|
||||
// TODO: Fir2Ir generates overrides as finals.
|
||||
// WORKS_WHEN_VALUE_CLASS
|
||||
|
||||
@JvmInline
|
||||
OPTIONAL_JVM_INLINE_ANNOTATION
|
||||
value class Inlined(val value: Int)
|
||||
|
||||
sealed interface A {
|
||||
|
||||
+15
-1
@@ -1,6 +1,20 @@
|
||||
// In this test, stdlib class `public value class Result<out T>` within `kotlin` package is replaced with a custom non-generic class
|
||||
|
||||
// NATIVE exception: java.util.NoSuchElementException: Collection contains no element matching the predicate
|
||||
// during `KonanSymbols.kotlinResultGetOrThrow`, since function `Result<T>.getOrThrow()` within `kotlin` package cannot be found during builtins construction,
|
||||
// since unbound class `Result` is expected, but deserialized one found.
|
||||
// DONT_TARGET_EXACT_BACKEND: NATIVE
|
||||
|
||||
// WASM exception:
|
||||
// There are still 4 unbound symbols after generation of IR module <main>:
|
||||
// Unbound public symbol IrClassPublicSymbolImpl: kotlin/Result.Companion|null[0]
|
||||
// Unbound public symbol IrClassPublicSymbolImpl: kotlin/Result.Failure|null[0]
|
||||
// Unbound public symbol IrSimpleFunctionPublicSymbolImpl: kotlin/Result.Companion.success|8035950532576827725[0]
|
||||
// Unbound public symbol IrSimpleFunctionPublicSymbolImpl: kotlin/Result.Failure.exception.<get-exception>|-7777496992132965566[0]
|
||||
// This could happen if there are two libraries, where one library was compiled against the different version of the other library than the one currently used in the project. Please check that the project configuration is correct and has consistent versions of dependencies.
|
||||
// IGNORE_BACKEND: WASM
|
||||
// IGNORE_BACKEND: ANDROID
|
||||
// IGNORE_BACKEND: NATIVE
|
||||
|
||||
// ALLOW_KOTLIN_PACKAGE
|
||||
// WITH_STDLIB
|
||||
// WORKS_WHEN_VALUE_CLASS
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
// NATIVE and WASM failure reasons see in `result.kt`
|
||||
// JS_IR error: <main> @ /box.kt:24:12: Constructor 'Result.<init>' can not be called: No constructor found for symbol 'kotlin/Result.<init>|-8731461708390519279[0]'
|
||||
// DONT_TARGET_EXACT_BACKEND: NATIVE
|
||||
// IGNORE_BACKEND: WASM, JS_IR, JS_IR_ES6
|
||||
// IGNORE_BACKEND: ANDROID
|
||||
// IGNORE_BACKEND: NATIVE
|
||||
|
||||
// ALLOW_KOTLIN_PACKAGE
|
||||
// WITH_STDLIB
|
||||
// WORKS_WHEN_VALUE_CLASS
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
// NATIVE, WASM, JS_IR errors are same as for `resultGeneric.kt`
|
||||
// DONT_TARGET_EXACT_BACKEND: NATIVE
|
||||
// IGNORE_BACKEND: WASM, JS_IR, JS_IR_ES6
|
||||
// IGNORE_BACKEND: ANDROID
|
||||
// IGNORE_BACKEND: NATIVE
|
||||
|
||||
// ALLOW_KOTLIN_PACKAGE
|
||||
// WITH_STDLIB
|
||||
// WORKS_WHEN_VALUE_CLASS
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
// IGNORE_BACKEND: WASM
|
||||
// WASM_MUTE_REASON: IGNORED_IN_JS
|
||||
// IGNORE_BACKEND: JS, JS_IR, NATIVE, JVM
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
// JVM runtime exception: java.lang.ClassCastException: kotlin.Unit cannot be cast to Foo
|
||||
// IGNORE_BACKEND: JVM
|
||||
// WITH_STDLIB
|
||||
// WORKS_WHEN_VALUE_CLASS
|
||||
// LANGUAGE: +ValueClasses, +ValueClassesSecondaryConstructorWithBody
|
||||
@@ -9,7 +7,7 @@
|
||||
OPTIONAL_JVM_INLINE_ANNOTATION
|
||||
value class Foo(val x: String) {
|
||||
constructor(y: Int) : this("OK") {
|
||||
if (y == 0) return throw java.lang.IllegalArgumentException()
|
||||
if (y == 0) throw IllegalArgumentException()
|
||||
if (y == 1) return
|
||||
return Unit
|
||||
}
|
||||
|
||||
+4
-5
@@ -1,7 +1,6 @@
|
||||
// IGNORE_BACKEND: WASM
|
||||
// WASM_MUTE_REASON: IGNORED_IN_JS
|
||||
// IGNORE_BACKEND: JS, JS_IR, NATIVE, JVM
|
||||
// IGNORE_BACKEND: JS_IR_ES6
|
||||
// JVM backend throws runtime exception: java.lang.ClassCastException: kotlin.Unit cannot be cast to Foo
|
||||
// IGNORE_BACKEND: JVM
|
||||
// IGNORE_LIGHT_ANALYSIS
|
||||
// WITH_STDLIB
|
||||
// WORKS_WHEN_VALUE_CLASS
|
||||
// LANGUAGE: +ValueClasses, +GenericInlineClassParameter, +ValueClassesSecondaryConstructorWithBody
|
||||
@@ -9,7 +8,7 @@
|
||||
OPTIONAL_JVM_INLINE_ANNOTATION
|
||||
value class Foo<T: String>(val x: T) {
|
||||
constructor(y: Int) : this("OK" as T) {
|
||||
if (y == 0) return throw java.lang.IllegalArgumentException()
|
||||
if (y == 0) throw IllegalArgumentException()
|
||||
if (y == 1) return
|
||||
return Unit
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user