Fixed tests after adding error checking for intention tests.

This commit is contained in:
Zalim Bashorov
2014-04-01 20:49:24 +04:00
parent 8d19c7309b
commit b43958f4b3
399 changed files with 1376 additions and 906 deletions
@@ -1,7 +1,9 @@
fun doSomething<T>(a: T) {}
fun test() {
class Test{
fun contains(a: Int) : Boolean = true
}
val test = Test()
println(test.c<caret>ontains(0).toString())
doSomething(test.c<caret>ontains(0).toString())
}
@@ -1,7 +1,9 @@
fun doSomething<T>(a: T) {}
fun test() {
class Test{
fun contains(a: Int) : Boolean = true
}
val test = Test()
println((0 in test).toString())
doSomething((0 in test).toString())
}
@@ -1,7 +1,9 @@
fun doSomething<T>(a: T) {}
fun test() {
class Test{
fun contains(fn: () -> Boolean) : Boolean = true
}
val test = Test()
println(test.c<caret>ontains { true }.toString())
doSomething(test.c<caret>ontains { true }.toString())
}
@@ -1,7 +1,9 @@
fun doSomething<T>(a: T) {}
fun test() {
class Test{
fun contains(fn: () -> Boolean) : Boolean = true
}
val test = Test()
println(({ true } in test).toString())
doSomething(({ true } in test).toString())
}
@@ -1,4 +1,5 @@
// SHOULD_FAIL_WITH: invalid.arguments
// ERROR: Cannot find a parameter with this name: c
fun test() {
class Test{
fun contains(a: Int=1, b: Int=2): Boolean = true
@@ -1,4 +1,5 @@
// SHOULD_FAIL_WITH: duplicate.or.missing.arguments
// ERROR: No value passed for parameter b
fun test() {
class Test{
fun contains(a: Int, b: Int): Boolean = true
@@ -1,4 +1,6 @@
// SHOULD_FAIL_WITH: duplicate.or.missing.arguments
// ERROR: An argument is already passed for this parameter
// ERROR: No value passed for parameter b
fun test() {
class Test{
fun get(a: Int, b: Int) : Int = 0
@@ -1,4 +1,5 @@
// SHOULD_FAIL_WITH: invalid.arguments
// ERROR: Cannot find a parameter with this name: c
fun test() {
class Test{
fun get(a: Int=1, b: Int=2) : Int = 0
@@ -1,4 +1,5 @@
// SHOULD_FAIL_WITH: duplicate.or.missing.arguments
// ERROR: No value passed for parameter b
fun test() {
class Test{
fun get(a: Int, b: Int) : Int = 0
@@ -1,9 +1,9 @@
fun test() {
class Test{
fun get(a: Int, b: Int, c: Int = 1, d: Int = 1 fn: (i: Int) -> Int) : Int = 0
fun get(a: Int, b: Int, c: Int = 1, d: Int = 1, fn: (i: Int) -> Int) : Int = 0
}
val test = Test()
test.g<caret>et(1, c=3, b=2) { i ->
test.g<caret>et(a=1, c=3, b=2, d=4) { i ->
i
}
}
@@ -1,9 +1,9 @@
fun test() {
class Test{
fun get(a: Int, b: Int, c: Int = 1, d: Int = 1 fn: (i: Int) -> Int) : Int = 0
fun get(a: Int, b: Int, c: Int = 1, d: Int = 1, fn: (i: Int) -> Int) : Int = 0
}
val test = Test()
test[1, 2, 3, { i ->
test[1, 2, 3, 4, { i ->
i
}]
}
@@ -1,4 +1,5 @@
// IS_APPLICABLE: false
// ERROR: Unresolved reference: got
fun test() {
class Test{
fun get(i: Int) : Int = 0
@@ -1,7 +1,9 @@
fun doSomething<T>(a: T) {}
fun test() {
class Test {
fun invoke(a: Int, vararg b: String, fn: () -> Unit): String = "test"
}
val test = Test()
println(test.i<caret>nvoke(1, "a", "b") { })
doSomething(test.i<caret>nvoke(1, "a", "b") { })
}
@@ -1,7 +1,9 @@
fun doSomething<T>(a: T) {}
fun test() {
class Test {
fun invoke(a: Int, vararg b: String, fn: () -> Unit): String = "test"
}
val test = Test()
println(test(1, "a", "b") { })
doSomething(test(1, "a", "b") { })
}
@@ -1,3 +1,5 @@
fun doSomething<T>(a: T) {}
fun test() {
class Test {
fun plus(): Test = Test()
@@ -5,5 +7,5 @@ fun test() {
fun minus(): Test = Test()
}
val test = Test()
println(-(test + test).pl<caret>us().toString())
doSomething((-((test + test).pl<caret>us())).toString())
}
@@ -1,3 +1,5 @@
fun doSomething<T>(a: T) {}
fun test() {
class Test {
fun plus(): Test = Test()
@@ -5,5 +7,5 @@ fun test() {
fun minus(): Test = Test()
}
val test = Test()
println(-(+(test + test)).toString())
doSomething((-(+(test + test))).toString())
}