[JS IR BE] Update test data
This commit is contained in:
committed by
Roman Artemev
parent
02628e8de3
commit
f69bd54d6c
+43
-23
@@ -7,12 +7,15 @@ fun bar(s: String) {
|
||||
global += s
|
||||
}
|
||||
|
||||
fun foo(s: String):String {
|
||||
fun foo(s: String): String {
|
||||
return s + "F"
|
||||
}
|
||||
|
||||
open class A(val s: String) {
|
||||
fun me():A { global += s; return this }
|
||||
fun me(): A {
|
||||
global += s; return this
|
||||
}
|
||||
|
||||
open val f = "A"
|
||||
}
|
||||
|
||||
@@ -22,33 +25,50 @@ class B(s: String) : A(s) {
|
||||
|
||||
fun test(b1: Boolean, b2: Boolean): String {
|
||||
global = ""
|
||||
bar(foo("G") + foo((if (b1) {
|
||||
bar("then1")
|
||||
(if (b2) {
|
||||
bar("then2")
|
||||
A("X")
|
||||
} else {
|
||||
bar("else2")
|
||||
B("Y")
|
||||
}).me()
|
||||
} else {
|
||||
bar("else1")
|
||||
(if (b2) {
|
||||
bar("then3")
|
||||
B("M")
|
||||
} else {
|
||||
bar("else3")
|
||||
A("N")
|
||||
}).me()
|
||||
}).f) + foo("S"))
|
||||
try {
|
||||
bar(
|
||||
foo("G") + foo(
|
||||
(if (b1) {
|
||||
bar("then1")
|
||||
(try {
|
||||
if (b2) {
|
||||
bar("then2")
|
||||
A("X")
|
||||
} else {
|
||||
bar("else2")
|
||||
B("Y")
|
||||
}
|
||||
} finally {
|
||||
|
||||
}).me()
|
||||
} else {
|
||||
try {
|
||||
bar("try3")
|
||||
bar("else1")
|
||||
} finally {
|
||||
|
||||
}
|
||||
(if (b2) {
|
||||
bar("then3")
|
||||
B("M")
|
||||
} else {
|
||||
bar("else3")
|
||||
A("N")
|
||||
}).me()
|
||||
}).f
|
||||
) + foo("S")
|
||||
)
|
||||
} finally {
|
||||
|
||||
}
|
||||
|
||||
return global
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
|
||||
assertEquals(test(false, false), "else1else3NGFAFSF")
|
||||
assertEquals(test(false, true), "else1then3MGFBFSF")
|
||||
assertEquals(test(false, false), "try3else1else3NGFAFSF")
|
||||
assertEquals(test(false, true), "try3else1then3MGFBFSF")
|
||||
assertEquals(test(true, false), "then1else2YGFBFSF")
|
||||
assertEquals(test(true, true), "then1then2XGFAFSF")
|
||||
return "OK"
|
||||
|
||||
Reference in New Issue
Block a user