[Test] Migrate AbstractExtendedFirDiagnosticsTest to new infrastructure

This commit is contained in:
Dmitriy Novozhilov
2020-12-18 14:23:48 +03:00
committed by TeamCityServer
parent a276d05917
commit 298e27bdac
164 changed files with 1729 additions and 1281 deletions
@@ -0,0 +1,7 @@
FILE: StringTemplate.kt
public abstract interface IC : R|kotlin/Any| {
public open fun toString(x: R|kotlin/String|): R|kotlin/String| {
^toString <strcat>(String(IC), R|<local>/x|.R|kotlin/Any.toString|())
}
}
@@ -0,0 +1,3 @@
interface IC {
fun toString(x: String): String = "IC$x"
}
@@ -0,0 +1,15 @@
FILE: booleanToInt.kt
public final fun R|kotlin/Boolean|.toInt(): R|kotlin/Int| {
^toInt when () {
this@R|/toInt| -> {
Int(1)
}
else -> {
Int(0)
}
}
}
public final fun test(x: R|kotlin/Int|, y: R|kotlin/Int|): R|kotlin/Int| {
^test CMP(>, R|<local>/x|.R|kotlin/Int.compareTo|(R|<local>/y|)).R|/toInt|()
}
@@ -0,0 +1,7 @@
// IS_APPLICABLE: false
fun Boolean.toInt() = if (this) 1 else 0
fun test(x: Int, y: Int): Int {
return (x > y).toInt()
}
@@ -0,0 +1,3 @@
FILE: byte.kt
public final val foo: R|kotlin/Byte| = Q|kotlin/Byte|.R|kotlin/Byte.Companion.MAX_VALUE|.R|kotlin/Byte.toByte|()
public get(): R|kotlin/Byte|
@@ -0,0 +1,2 @@
// WITH_RUNTIME
val foo = Byte.MAX_VALUE.<!REDUNDANT_CALL_OF_CONVERSION_METHOD!>toByte()<!>
@@ -0,0 +1,3 @@
FILE: char.kt
public final val foo: R|kotlin/Char| = Char(a).R|kotlin/Char.toChar|()
public get(): R|kotlin/Char|
@@ -0,0 +1,2 @@
// WITH_RUNTIME
val foo = 'a'.<!REDUNDANT_CALL_OF_CONVERSION_METHOD!>toChar()<!>
@@ -0,0 +1,3 @@
FILE: double.kt
public final val foo: R|kotlin/Double| = Double(1.1).R|kotlin/Double.toDouble|()
public get(): R|kotlin/Double|
@@ -0,0 +1,2 @@
// WITH_RUNTIME
val foo = 1.1.<!REDUNDANT_CALL_OF_CONVERSION_METHOD!>toDouble()<!>
@@ -0,0 +1,3 @@
FILE: float.kt
public final val foo: R|kotlin/Float| = Float(1.1).R|kotlin/Float.toFloat|()
public get(): R|kotlin/Float|
@@ -0,0 +1,2 @@
// WITH_RUNTIME
val foo = 1.1f.<!REDUNDANT_CALL_OF_CONVERSION_METHOD!>toFloat()<!>
@@ -0,0 +1,3 @@
FILE: int.kt
public final val foo: R|kotlin/Int| = Int(1).R|kotlin/Int.toInt|()
public get(): R|kotlin/Int|
@@ -0,0 +1,2 @@
// WITH_RUNTIME
val foo = 1.<!REDUNDANT_CALL_OF_CONVERSION_METHOD!>toInt()<!>
@@ -0,0 +1,3 @@
FILE: long.kt
public final val foo: R|kotlin/Long| = Q|kotlin/Long|.R|kotlin/Long.Companion.MAX_VALUE|.R|kotlin/Long.toLong|()
public get(): R|kotlin/Long|
@@ -0,0 +1,2 @@
// WITH_RUNTIME
val foo = Long.MAX_VALUE.<!REDUNDANT_CALL_OF_CONVERSION_METHOD!>toLong()<!>
@@ -0,0 +1,4 @@
FILE: nullable.kt
public final fun foo(s: R|kotlin/String?|): R|kotlin/Unit| {
lval t: R|kotlin/String| = R|<local>/s|.R|kotlin/toString|()
}
@@ -0,0 +1,5 @@
// WITH_RUNTIME
// IS_APPLICABLE: false
fun foo(s: String?) {
<!UNUSED_VARIABLE{LT}!>val <!UNUSED_VARIABLE{PSI}!>t<!>: String = s.toString()<!>
}
@@ -0,0 +1,17 @@
FILE: nullable2.kt
public final data class Foo : R|kotlin/Any| {
public constructor(name: R|kotlin/String|): R|Foo| {
super<R|kotlin/Any|>()
}
public final val name: R|kotlin/String| = R|<local>/name|
public get(): R|kotlin/String|
public final fun component1(): R|kotlin/String|
public final fun copy(name: R|kotlin/String| = this@R|/Foo|.R|/Foo.name|): R|Foo|
}
public final fun nullable2(foo: R|Foo?|): R|kotlin/Unit| {
lval s: R|kotlin/String| = R|<local>/foo|?.{ $subj$.R|/Foo.name| }.R|kotlin/toString|()
}
@@ -0,0 +1,7 @@
// IS_APPLICABLE: false
// WITH_RUNTIME
data class Foo(val name: String)
fun nullable2(foo: Foo?) {
<!UNUSED_VARIABLE{LT}!>val <!UNUSED_VARIABLE{PSI}!>s<!>: String = foo?.name.toString()<!>
}
@@ -0,0 +1,5 @@
FILE: safeString.kt
public final fun test(): R|kotlin/Unit| {
lval foo: R|kotlin/String?| = Null(null)
R|<local>/foo|?.{ $subj$.R|kotlin/Any.toString|() }
}
@@ -0,0 +1,6 @@
// WITH_RUNTIME
fun test() {
val foo: String? = null
foo?.<!REDUNDANT_CALL_OF_CONVERSION_METHOD!>toString()<!>
}
@@ -0,0 +1,17 @@
FILE: safeString2.kt
public final data class Foo : R|kotlin/Any| {
public constructor(name: R|kotlin/String|): R|Foo| {
super<R|kotlin/Any|>()
}
public final val name: R|kotlin/String| = R|<local>/name|
public get(): R|kotlin/String|
public final fun component1(): R|kotlin/String|
public final fun copy(name: R|kotlin/String| = this@R|/Foo|.R|/Foo.name|): R|Foo|
}
public final fun test(foo: R|Foo?|): R|kotlin/Unit| {
lval s: R|kotlin/String?| = R|<local>/foo|?.{ $subj$.R|/Foo.name| }?.{ $subj$.R|kotlin/Any.toString|() }
}
@@ -0,0 +1,6 @@
// WITH_RUNTIME
data class Foo(val name: String)
fun test(foo: Foo?) {
<!UNUSED_VARIABLE{LT}!>val <!UNUSED_VARIABLE{PSI}!>s<!>: String? = foo?.name?.<!REDUNDANT_CALL_OF_CONVERSION_METHOD!>toString()<!><!>
}
@@ -0,0 +1,3 @@
FILE: short.kt
public final val foo: R|kotlin/Short| = Q|kotlin/Short|.R|kotlin/Short.Companion.MAX_VALUE|.R|kotlin/Short.toShort|()
public get(): R|kotlin/Short|
@@ -0,0 +1,2 @@
// WITH_RUNTIME
val foo = Short.MAX_VALUE.<!REDUNDANT_CALL_OF_CONVERSION_METHOD!>toShort()<!>
@@ -0,0 +1,3 @@
FILE: string.kt
public final val foo: R|kotlin/String| = String().R|kotlin/Any.toString|()
public get(): R|kotlin/String|
@@ -0,0 +1,2 @@
// WITH_RUNTIME
val foo = "".<!REDUNDANT_CALL_OF_CONVERSION_METHOD!>toString()<!>
@@ -0,0 +1,3 @@
FILE: toOtherType.kt
public final val foo: R|kotlin/Long| = Int(1).R|kotlin/Int.toLong|()
public get(): R|kotlin/Long|
@@ -0,0 +1,3 @@
// WITH_RUNTIME
// IS_APPLICABLE: false
val foo = 1.toLong()
@@ -0,0 +1,4 @@
FILE: uByte.kt
public final fun test(i: R|kotlin/UByte|): R|kotlin/Unit| {
lval foo: R|kotlin/UByte| = R|<local>/i|.R|kotlin/UByte.toUByte|()
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(i: UByte) {
<!UNUSED_VARIABLE{LT}!>val <!UNUSED_VARIABLE{PSI}!>foo<!> = i.<!REDUNDANT_CALL_OF_CONVERSION_METHOD!>toUByte()<!><!>
}
@@ -0,0 +1,4 @@
FILE: uInt.kt
public final fun test(i: R|kotlin/UInt|): R|kotlin/Unit| {
lval foo: R|kotlin/UInt| = R|<local>/i|.R|kotlin/UInt.toUInt|()
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(i: UInt) {
<!UNUSED_VARIABLE{LT}!>val <!UNUSED_VARIABLE{PSI}!>foo<!> = i.<!REDUNDANT_CALL_OF_CONVERSION_METHOD!>toUInt()<!><!>
}
@@ -0,0 +1,4 @@
FILE: uLong.kt
public final fun test(i: R|kotlin/ULong|): R|kotlin/Unit| {
lval foo: R|kotlin/ULong| = R|<local>/i|.R|kotlin/ULong.toULong|()
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(i: ULong) {
<!UNUSED_VARIABLE{LT}!>val <!UNUSED_VARIABLE{PSI}!>foo<!> = i.<!REDUNDANT_CALL_OF_CONVERSION_METHOD!>toULong()<!><!>
}
@@ -0,0 +1,4 @@
FILE: uShort.kt
public final fun test(i: R|kotlin/UShort|): R|kotlin/Unit| {
lval foo: R|kotlin/UShort| = R|<local>/i|.R|kotlin/UShort.toUShort|()
}
@@ -0,0 +1,4 @@
// WITH_RUNTIME
fun test(i: UShort) {
<!UNUSED_VARIABLE{LT}!>val <!UNUSED_VARIABLE{PSI}!>foo<!> = i.<!REDUNDANT_CALL_OF_CONVERSION_METHOD!>toUShort()<!><!>
}
@@ -0,0 +1,5 @@
FILE: variable.kt
public final val foo: R|kotlin/String| = String()
public get(): R|kotlin/String|
public final val bar: R|kotlin/String| = R|/foo|.R|kotlin/Any.toString|()
public get(): R|kotlin/String|
@@ -0,0 +1,3 @@
// WITH_RUNTIME
val foo = ""
val bar = foo.<!REDUNDANT_CALL_OF_CONVERSION_METHOD!>toString()<!>