Scratch: tests for repl execution

This commit is contained in:
Natalia Selezneva
2017-12-27 12:00:16 +03:00
parent 1a84c05db2
commit dda0b38fb9
17 changed files with 204 additions and 1 deletions
+3
View File
@@ -0,0 +1,3 @@
for (i in 0..5) {
println(i)
}
+3
View File
@@ -0,0 +1,3 @@
for (i in 0..5) { // OUTPUT: 0; 1; 2; 3; 4; 5
println(i)
}
+2
View File
@@ -0,0 +1,2 @@
val a = 1
a
+2
View File
@@ -0,0 +1,2 @@
val a = 1
a // RESULT: 1
+5
View File
@@ -0,0 +1,5 @@
fun foo(): Int {
return 1
}
foo()
+5
View File
@@ -0,0 +1,5 @@
fun foo(): Int {
return 1
}
foo() // RESULT: 1
+3
View File
@@ -0,0 +1,3 @@
arrayListOf(1, 5, 7).map { it * 2 } // RESULT: 2
.filter { it < 10 }
.find { it == 2 }
+3
View File
@@ -0,0 +1,3 @@
arrayListOf(1, 5, 7).map { it * 2 }
.filter { it < 10 }
.find { it == 2 }
+3
View File
@@ -0,0 +1,3 @@
arrayListOf(1, 5, 7).map { it * 2 } // RESULT: 2
.filter { it < 10 }
.find { it == 2 }
+1
View File
@@ -0,0 +1 @@
foo()
+1
View File
@@ -0,0 +1 @@
foo() // ERROR: error: unresolved reference: foo
+1
View File
@@ -0,0 +1 @@
println("hello")
+1
View File
@@ -0,0 +1 @@
println("hello") // OUTPUT: hello