IR, testing framework: if no tree labels were provided in source file, use default golden file.

This commit is contained in:
Dmitry Petrov
2016-08-17 11:59:36 +03:00
committed by Dmitry Petrov
parent aee83f5a77
commit 64d7a97145
15 changed files with 4 additions and 15 deletions
@@ -90,6 +90,10 @@ abstract class AbstractIrTextTestCase : AbstractIrGeneratorTestCase() {
}
}
if (treeFiles.isEmpty()) {
treeFiles.add(IrTreeFileLabel(File(dir, testFile.name.replace(".kt", ".txt")), 0))
}
return Expectations(regexps, treeFiles)
}
-1
View File
@@ -1,4 +1,3 @@
// <<< arrayAssignment.txt
fun test() {
val x = intArrayOf(1, 2, 3)
x[1] = 0
-1
View File
@@ -1,4 +1,3 @@
// <<< assignments.txt
class Ref(var x: Int)
fun test1() {
-1
View File
@@ -1,4 +1,3 @@
// <<< augmentedAssignment1.txt
var p = 0
fun testVariable() {
-2
View File
@@ -1,5 +1,3 @@
// <<< augmentedAssignment2.txt
class A
operator fun A.plusAssign(s: String) {}
@@ -1,4 +1,3 @@
// <<< augmentedAssignmentArray.txt
fun foo(): IntArray = intArrayOf(1, 2, 3)
fun testVariable() {
-1
View File
@@ -1,2 +1 @@
// <<< boxOk.txt
fun box(): String = "OK"
@@ -1,4 +1,3 @@
// <<< callWithReorderedArguments.txt
fun foo(a: Int, b: Int) {}
fun noReorder1() = 1
-1
View File
@@ -1,4 +1,3 @@
// <<< calls.txt
fun foo(x: Int, y: Int) = x
fun bar(x: Int) = foo(x, 1)
fun qux(x: Int) = foo(foo(x, x), x)
-1
View File
@@ -1,3 +1,2 @@
// <<< dotQualified.txt
fun length(s: String) = s.length
fun lengthN(s: String?) = s?.length
@@ -1,3 +1,2 @@
// <<< extensionPropertyGetterCall.txt
val String.okext: String get() = "OK"
fun String.test5() = okext
-1
View File
@@ -1,4 +1,3 @@
// <<< references.txt
val ok = "OK"
val ok2 = ok
val ok3: String get() = "OK"
-1
View File
@@ -1,4 +1,3 @@
// <<< smartCasts.txt
fun expectsString(s: String) {}
fun expectsInt(i: Int) {}
@@ -1,4 +1,3 @@
// <<< smartCastsWithDestructuring.txt
interface I1
interface I2
-1
View File
@@ -1,4 +1,3 @@
// <<< smoke.txt
fun testFun(): String { return "OK" }
val testSimpleVal = 1
val testValWithGetter: Int get() = 42