[Test] Replace public fun box() with fun box() in all box tests

This commit is contained in:
Dmitriy Novozhilov
2021-07-14 15:58:48 +03:00
committed by teamcityserver
parent c168a561df
commit b9c549803d
31 changed files with 40 additions and 40 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
// WASM_MUTE_REASON: STDLIB_COLLECTIONS
// KJS_WITH_FULL_RUNTIME
fun box () : String {
fun box() : String {
val s = ArrayList<String>()
s.add("foo")
s[0] += "bar"
+1 -1
View File
@@ -3,7 +3,7 @@
public class SomeClass() : java.lang.Object() {
}
public fun box():String {
fun box():String {
System.out?.println(SomeClass().getClass())
return "OK"
}
+1 -1
View File
@@ -1,4 +1,4 @@
public fun box() : String {
fun box() : String {
if ( 0 == 0 ) { // Does not crash if either this...
if ( 0 == 0 ) { // ...or this is changed to if ( true )
// Does not crash if the following is uncommented.
+1 -1
View File
@@ -7,7 +7,7 @@ class Outer() {
}
}
fun box (): String {
fun box(): String {
val inner = Outer.Companion.Inner()
return "OK"
}
+1 -1
View File
@@ -1,6 +1,6 @@
operator fun Int?.inc() : Int { if (this != null) return this.inc() else throw NullPointerException() }
public fun box() : String {
fun box() : String {
var i : Int? = 10
val j = i++
+1 -1
View File
@@ -1,6 +1,6 @@
operator fun Int?.inc() = this!!.inc()
public fun box() : String {
fun box() : String {
var i : Int? = 10
val j = i++
+1 -1
View File
@@ -22,4 +22,4 @@ public open class PerfectNumberFinder() {
}
}
fun box () = if (PerfectNumberFinder().isPerfect(28)) "OK" else "fail"
fun box() = if (PerfectNumberFinder().isPerfect(28)) "OK" else "fail"
+1 -1
View File
@@ -12,7 +12,7 @@ class ImplClass: BaseClass() {
override val menuId: Int = 3
}
public fun box(): String {
fun box(): String {
val result = ImplClass().run()
if (result != ("3" to false)) return "Fail: $result"
+1 -1
View File
@@ -2,7 +2,7 @@ fun Any.with(operation : Any.() -> Any) = operation().toString()
val f = { a : Int -> }
fun box () : String {
fun box() : String {
return if(20.with {
this
} == "20")
@@ -1,4 +1,4 @@
public fun box() : String {
fun box() : String {
var i : Int?
i = 10
// assignPlus on a smart cast should work
@@ -1,4 +1,4 @@
public fun box() : String {
fun box() : String {
var i : Int?
i = 10
// We have "double" smart cast here:
@@ -3,7 +3,7 @@ class Derived: Base
class Another: Base
operator fun Base.inc(): Derived { return Derived() }
public fun box() : String {
fun box() : String {
var i : Base
i = Another()
val j = i++
@@ -2,7 +2,7 @@ open class Base
class Derived: Base()
operator fun Derived.inc(): Derived { return Derived() }
public fun box() : String {
fun box() : String {
var i : Base
i = Derived()
val j = i++
@@ -1,4 +1,4 @@
public fun box() : String {
fun box() : String {
var i : Short?
i = 10
// Postfix increment on a smart casted short should work
@@ -1,4 +1,4 @@
public fun box() : String {
fun box() : String {
var i : Int?
i = 10
// Postfix increment on a smart cast should work
@@ -2,7 +2,7 @@ class MyClass
operator fun MyClass?.inc(): MyClass? = null
public fun box() : String {
fun box() : String {
var i : MyClass?
i = MyClass()
val j = i++
@@ -2,7 +2,7 @@ operator fun Int?.inc(): Int? = this
fun init(): Int? { return 10 }
public fun box() : String {
fun box() : String {
var i : Int? = init()
val j = i++
@@ -3,7 +3,7 @@ class Derived: Base
class Another: Base
operator fun Base.inc(): Derived { return Derived() }
public fun box() : String {
fun box() : String {
var i : Base
i = Another()
val j = ++i
@@ -2,7 +2,7 @@ open class Base
class Derived: Base()
operator fun Derived.inc(): Derived { return Derived() }
public fun box() : String {
fun box() : String {
var i : Base
i = Derived()
val j = ++i
@@ -1,4 +1,4 @@
public fun box() : String {
fun box() : String {
var i : Int?
i = 10
// Prefix increment on a smart cast should work
@@ -2,7 +2,7 @@ class MyClass
operator fun MyClass?.inc(): MyClass? = null
public fun box() : String {
fun box() : String {
var i : MyClass?
i = MyClass()
val j = ++i
@@ -2,7 +2,7 @@ operator fun Int?.inc(): Int? = this
fun init(): Int? { return 10 }
public fun box() : String {
fun box() : String {
var i : Int? = init()
val j = ++i
+1 -1
View File
@@ -41,7 +41,7 @@ public class SomeClass() {
}
}
public fun box(): String {
fun box(): String {
var obj = SomeClass()
return if (obj.status == null) "OK" else {
(obj.status as java.lang.Throwable).printStackTrace()
+1 -1
View File
@@ -1,4 +1,4 @@
fun box () : String {
fun box() : String {
val b = 4.toByte()
val s = 5.toShort()
val c: Char = 'A'
+1 -1
View File
@@ -9,7 +9,7 @@ fun foo(i : Int?, a : Any?) {
}
}
fun box () : String {
fun box() : String {
foo(2, "239")
return "OK"
}
+1 -1
View File
@@ -23,7 +23,7 @@ fun test(a : A) {
}
}
public fun box() : String {
fun box() : String {
AImpl().test
test(AImpl())
return "OK"
+1 -1
View File
@@ -6,7 +6,7 @@ class AImpl : A {
override val v: Int = 5
}
public fun box() : String {
fun box() : String {
val a: A = AImpl()
a.v
return "OK"
+1 -1
View File
@@ -10,7 +10,7 @@ package test2
import test.A
public fun box(): String {
fun box(): String {
return B().test(B())
}
+1 -1
View File
@@ -16,7 +16,7 @@ class C : A() {
}
}
public fun box(): String {
fun box(): String {
return C().a()
}
+10 -10
View File
@@ -11,15 +11,15 @@ fun sample() : Reader {
World""");
}
fun box() : String {
// NOTE: Also tested in stdlib: LineIteratorTest.useLines
fun box() : String {
// NOTE: Also tested in stdlib: LineIteratorTest.useLines
// TODO compiler error
// both these expressions causes java.lang.NoClassDefFoundError: collections/CollectionPackage
val list1 = sample().useLines { it.toList() }
val list2 = sample().useLines<ArrayList<String>>{ it.toCollection(arrayListOf()) }
// TODO compiler error
// both these expressions causes java.lang.NoClassDefFoundError: collections/CollectionPackage
val list1 = sample().useLines { it.toList() }
val list2 = sample().useLines<ArrayList<String>>{ it.toCollection(arrayListOf()) }
if(arrayListOf("Hello", "World") != list1) return "fail"
if(arrayListOf("Hello", "World") != list2) return "fail"
return "OK"
}
if(arrayListOf("Hello", "World") != list1) return "fail"
if(arrayListOf("Hello", "World") != list2) return "fail"
return "OK"
}