JS backend: _commonFiles/ for common kotlin files in testData/ and every test dir
This commit is contained in:
committed by
Zalim Bashorov
parent
9b433e31a2
commit
dd3dbe5b10
@@ -7,10 +7,6 @@ val bar = { Int.(a: Int) -> this * a }
|
||||
|
||||
fun test(op: Int.(Int) -> Int) = 3 op 20
|
||||
|
||||
fun assertEquals<T>(expected: T, actual: T) {
|
||||
if (expected != actual) throw Exception("expected: $expected, actual: $actual")
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val op = { Int.(a: Int) -> this / a }
|
||||
|
||||
|
||||
@@ -137,14 +137,6 @@ open private class OpenPrivateClass {
|
||||
|
||||
// Helpers
|
||||
|
||||
native
|
||||
fun String.search(regexp: RegExp): Int = noImpl
|
||||
|
||||
native
|
||||
class RegExp(regexp: String, flags: String = "") {
|
||||
fun exec(s: String): Array<String>? = noImpl
|
||||
}
|
||||
|
||||
val CALEE_NAME = RegExp("""\b\w*(baz[^(]*)""")
|
||||
|
||||
fun Function0<Unit>.extractNames(): Array<String> {
|
||||
|
||||
@@ -34,14 +34,6 @@ private class PrivateClass {
|
||||
|
||||
// Helpers
|
||||
|
||||
native
|
||||
fun String.search(regexp: RegExp): Int = noImpl
|
||||
|
||||
native
|
||||
class RegExp(regexp: String, flags: String = "") {
|
||||
fun exec(s: String): Array<String>? = noImpl
|
||||
}
|
||||
|
||||
val CALEE_NAME = RegExp("""((?:equals|hashCode|toString)[^(]*)""")
|
||||
|
||||
fun <T> Function0<T>.extractNames(): Array<String> {
|
||||
|
||||
-13
@@ -17,15 +17,6 @@ public class A : T {
|
||||
fun boo(i: Int): String = "A.boo" + i
|
||||
}
|
||||
|
||||
// Helpers
|
||||
native
|
||||
fun String.replace(regexp: RegExp, replacement: String): String = noImpl
|
||||
|
||||
fun String.replaceAll(regexp: String, replacement: String): String = replace(RegExp(regexp, "g"), replacement)
|
||||
|
||||
native
|
||||
class RegExp(regexp: String, flags: String)
|
||||
|
||||
//Testing
|
||||
|
||||
fun test(testName: String, ff: Any, fb: Any) {
|
||||
@@ -35,10 +26,6 @@ fun test(testName: String, ff: Any, fb: Any) {
|
||||
if (f != b) throw Exception("FAILED on ${testName}:\n f = \"$f\"\n b = \"$b\"")
|
||||
}
|
||||
|
||||
fun assertEquals<T>(expected: T, actual: T) {
|
||||
if (expected != actual) throw Exception("expected: $expected, actual: $actual")
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
val a = A()
|
||||
|
||||
|
||||
@@ -115,15 +115,6 @@ class TestMixed {
|
||||
val mixed_in_class_f = TestMixed().f
|
||||
val mixed_in_class_b = TestMixed().b
|
||||
|
||||
// Helpers
|
||||
native
|
||||
fun String.replace(regexp: RegExp, replacement: String): String = noImpl
|
||||
|
||||
fun String.replaceAll(regexp: String, replacement: String): String = replace(RegExp(regexp, "g"), replacement)
|
||||
|
||||
native
|
||||
class RegExp(regexp: String, flags: String)
|
||||
|
||||
//Testing
|
||||
|
||||
fun test(testName: String, ff: Any, fb: Any) {
|
||||
|
||||
-4
@@ -6,10 +6,6 @@ class Foo(val name: String)
|
||||
|
||||
fun Foo() = Foo("<default-name>")
|
||||
|
||||
fun assertEquals(expected: Any, actual: Any) {
|
||||
if (expected != actual) throw Exception("expected = $expected, actual = $actual")
|
||||
}
|
||||
|
||||
fun box(): String {
|
||||
assertEquals("<default-name>", Foo().name)
|
||||
assertEquals("BarBaz", Foo("BarBaz").name)
|
||||
|
||||
@@ -2,10 +2,6 @@
|
||||
|
||||
package foo
|
||||
|
||||
fun assertEquals(expected: Any, actual: Any) {
|
||||
if (expected != actual) throw Exception("expected = $expected, actual = $actual")
|
||||
}
|
||||
|
||||
trait I {
|
||||
fun test(): String
|
||||
}
|
||||
|
||||
@@ -12,9 +12,6 @@ class C : A, B {
|
||||
fun foo() = "C"
|
||||
}
|
||||
|
||||
fun assertEquals(expected: Any, actual: Any) {
|
||||
if (expected != actual) throw Exception("expected = $expected, actual = $actual")
|
||||
}
|
||||
fun box(): String {
|
||||
assertEquals("A", C().foo(1))
|
||||
assertEquals("B", C().foo(""))
|
||||
|
||||
Reference in New Issue
Block a user