Skip to content

Commit

Permalink
Fix failing tests, copy testData
Browse files Browse the repository at this point in the history
Some tests were using files that others called blackBoxFile() on. Since
those files are now moved to box/, copy them back to make the tests pass
  • Loading branch information
udalov committed Jan 28, 2013
1 parent 7ce62a5 commit 5313cf3
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 1 deletion.
17 changes: 17 additions & 0 deletions compiler/testData/codegen/componentEvaluatesOnlyOnce.kt
@@ -0,0 +1,17 @@
class S(val a: String, val b: String) {
fun component1() : String = a
fun component2() : String = b
}

fun S.component3() = ((a + b) as java.lang.String).substring(2)

class Tester() {
fun box() : String {
val (o,k,ok,ok2) = S("O","K")
return o + k + ok + ok2
}

fun S.component4() = ((a + b) as java.lang.String).substring(2)
}

fun box() = Tester().box()
10 changes: 10 additions & 0 deletions compiler/testData/codegen/enum/abstractmethod.kt
@@ -0,0 +1,10 @@
fun box() = IssueState.DEFAULT.ToString() + IssueState.FIXED.ToString()

enum class IssueState {
DEFAULT
FIXED {
override fun ToString() = "K"
}

open fun ToString() : String = "O"
}
6 changes: 6 additions & 0 deletions compiler/testData/codegen/enum/name.kt
@@ -0,0 +1,6 @@
enum class State {
O
K
}

fun box() = "${State.O.name()}${State.K.name()}"
12 changes: 12 additions & 0 deletions compiler/testData/codegen/enum/simple.kt
@@ -0,0 +1,12 @@
enum class Season {
WINTER
SPRING
SUMMER
AUTUMN
}

fun foo(): Season = Season.SPRING

fun box() =
if (foo() == Season.SPRING) "OK"
else "fail"
Expand Up @@ -25,7 +25,7 @@
public class ComponentGenTest extends CodegenTestCase {
public void testComponent() {
createEnvironmentWithMockJdkAndIdeaAnnotations(ConfigurationKind.JDK_ONLY);
blackBoxFile("/multiDecl/component.kt");
blackBoxFile("componentEvaluatesOnlyOnce.kt");

String asm = generateToText();
//System.out.println(asm);
Expand Down

0 comments on commit 5313cf3

Please sign in to comment.