Script refactoring, codegen tests: change test data according to semantics change

Add some new tests for uncovered cases
This commit is contained in:
Pavel V. Talanov
2015-11-17 15:14:15 +03:00
parent 6563830584
commit ad58617753
22 changed files with 42 additions and 26 deletions
+5
View File
@@ -0,0 +1,5 @@
var x = 0
x++
x++
x++
// expected: x: 3
+1 -2
View File
@@ -1,2 +1 @@
// expected: rv: null
// expected: rv: <nofield>
+2 -2
View File
@@ -1,2 +1,2 @@
// expected: rv: null
System.out!!.println("hello world")
// expected: rv: <nofield>
System.out!!.println("hello world")
+1 -1
View File
@@ -11,4 +11,4 @@ fun main(): Int {
return foo { x -> bar(x) }
}
main()
val rv = main()
+1 -1
View File
@@ -11,4 +11,4 @@ fun main(): Int {
return foo { x -> bar(x) }
}
main()
val rv = main()
+1 -1
View File
@@ -2,4 +2,4 @@
// param: what: kotlin.String: sky
// param: color: kotlin.String: blue
"$what color is $color"
val rv = "$what color is $color"
+1 -1
View File
@@ -1,4 +1,4 @@
// param: args: kotlin.Array<kotlin.String>: three little words
// expected: rv: little
args[1]
val rv = args[1]
+1 -1
View File
@@ -2,6 +2,6 @@
fun addX(y: Int) = x + y
addX(3)
val rv = addX(3)
// expected: rv: 13
+1 -1
View File
@@ -2,4 +2,4 @@
// param: aa: kotlin.Long: 17
// param: bb: kotlin.Int: 2
aa + bb
val rv = aa + bb
+2 -2
View File
@@ -1,10 +1,10 @@
val x: Int
var x: Int = 0
if (true) {
fun foo(y: Int) = y + 20
x = foo(9)
}
x
val rv = x
// expected: rv: 29
@@ -1,11 +1,11 @@
val z = 30
val x: Int
var x: Int = 0
if (true) {
fun foo() = z + 20
x = foo()
}
x
val rv = x
// expected: rv: 50
-3
View File
@@ -2,7 +2,4 @@ if (true) {
val archenemy = "Jim Moriarty"
}
true
// expected: rv: true
// expected: archenemy: <nofield>
+1 -1
View File
@@ -2,6 +2,6 @@ class SimpleClass(val s: String) {
fun foo() = s
}
SimpleClass("OK").foo()
val rv = SimpleClass("OK").foo()
// expected: rv: OK
+1 -1
View File
@@ -1,3 +1,3 @@
"O" + "K"
val rv = "O" + "K"
// expected: rv: OK
+1 -1
View File
@@ -8,4 +8,4 @@ fun factorial(n: Int): Int {
return product
}
factorial(10)
val rv = factorial(10)
@@ -2,6 +2,6 @@ val x = 12
fun foo(y: Int) = x + y
foo(33)
val rv = foo(33)
// expected: rv: 45