Added new string tests

This commit is contained in:
Michael Bogdanov
2015-04-03 18:27:08 +03:00
parent a19c1ed476
commit 0efe8890b8
7 changed files with 98 additions and 6 deletions

View File

@@ -0,0 +1,16 @@
class A() {
override fun toString(): String {
return "A"
}
}
fun box() : String {
val s = "1" + "2" + 3 + 4L + 5.0 + 6F + '7' + A()
return "OK"
}
// 1 NEW java/lang/StringBuilder

View File

@@ -0,0 +1,17 @@
class A() {
override fun toString(): String {
return "A"
}
}
fun box() : String {
val s = "1" plus "2" plus 3 plus 4L plus 5.0 plus 6F plus '7' plus A()
return "OK"
}
/*TODO:
1 NEW java/lang/StringBuilder*/

View File

@@ -0,0 +1,16 @@
class A() {
override fun toString(): String {
return "A"
}
}
fun box() : String {
val p = 1
val s = "${p}${2}${3}${4L}${5.0}${6F}${7}${A()}"
return "OK"
}
// 1 NEW java/lang/StringBuilder

View File

@@ -0,0 +1,16 @@
class A() {
override fun toString(): String {
return "A"
}
}
fun box() : String {
var s = "1"
s += "2" + 3 + 4L + 5.0 + 6F + '7' + A()
return "OK"
}
// 1 NEW java/lang/StringBuilder