From 33360c2528103cf0c15286513afad2169c108639 Mon Sep 17 00:00:00 2001 From: Zalim Bashorov Date: Wed, 5 Feb 2014 16:41:10 +0400 Subject: [PATCH] Dropped some TODOs #KT-2564 Obsolete. Looks like, it's fixed in dcddd04. --- .../compilerMessages/MockCompileContext.java | 4 +- .../k2js/test/semantics/MiscTest.java | 6 +- libraries/stdlib/test/PreconditionsTest.kt | 92 +++++++++---------- .../stdlib/test/StandardCollectionTest.kt | 5 +- 4 files changed, 51 insertions(+), 56 deletions(-) diff --git a/idea/tests/org/jetbrains/jet/plugin/compilerMessages/MockCompileContext.java b/idea/tests/org/jetbrains/jet/plugin/compilerMessages/MockCompileContext.java index 2ae936b9f2b..7cce4a1839d 100644 --- a/idea/tests/org/jetbrains/jet/plugin/compilerMessages/MockCompileContext.java +++ b/idea/tests/org/jetbrains/jet/plugin/compilerMessages/MockCompileContext.java @@ -169,13 +169,13 @@ public class MockCompileContext implements CompileContextEx { throw new UnsupportedOperationException("org.jetbrains.jet.plugin.compilerMessages.MockCompileContext#requestRebuildNextTime"); } - // TODO mark with override when updating to IDEA 132.527+ + @Override public boolean isRebuildRequested() { throw new UnsupportedOperationException("org.jetbrains.jet.plugin.compilerMessages.MockCompileContext.isRebuildRequested"); } - // TODO mark with override when updating to IDEA 132.527+ @Nullable + @Override public String getRebuildReason() { throw new UnsupportedOperationException("org.jetbrains.jet.plugin.compilerMessages.MockCompileContext.getRebuildReason"); } diff --git a/js/js.tests/test/org/jetbrains/k2js/test/semantics/MiscTest.java b/js/js.tests/test/org/jetbrains/k2js/test/semantics/MiscTest.java index 92883d70256..42960324180 100644 --- a/js/js.tests/test/org/jetbrains/k2js/test/semantics/MiscTest.java +++ b/js/js.tests/test/org/jetbrains/k2js/test/semantics/MiscTest.java @@ -153,10 +153,8 @@ public final class MiscTest extends AbstractExpressionTest { fooBoxIsValue("OK"); } - //TODO: see http://youtrack.jetbrains.com/issue/KT-2564 - @SuppressWarnings("UnusedDeclaration") - public void TODO_testPackageLevelVarInRoot() throws Exception { - runFunctionOutputTest("packageLevelVarInRoot.kt", Namer.getRootPackageName(), "box", "OK"); + public void testPackageLevelVarInRoot() throws Exception { + runFunctionOutputTest("packageLevelVarInRoot.kt", Namer.getRootPackageName(), TEST_FUNCTION, "OK"); } public void testLazyPropertyGetterNotCalledOnStart() throws Exception { diff --git a/libraries/stdlib/test/PreconditionsTest.kt b/libraries/stdlib/test/PreconditionsTest.kt index 784fcc3e4aa..4ba0b97c93f 100644 --- a/libraries/stdlib/test/PreconditionsTest.kt +++ b/libraries/stdlib/test/PreconditionsTest.kt @@ -97,50 +97,50 @@ class PreconditionsTest() { } } -// TODO: uncomment when KT-1540 is resolved. -// test fun passingAssert() { -// assert(true) -// var called = false -// assert(true) { called = true; "some message" } -// -// assertFalse(called) -// } -// -// -// test fun failingAssert() { -// val error = fails { -// assert(false) -// } -// if(error is IllegalStateException) { -// assertNull(error.getMessage()) -// } else { -// fail("Invalid exception type: "+error) -// } -// } -// -// test fun passingAssertWithMessage() { -// assert(true, "Hello") -// } -// -// test fun failingAssertWithMessage() { -// val error = fails { -// assert(false, "Hello") -// } -// if(error is IllegalStateException) { -// assertEquals("Hello", error.getMessage()) -// } else { -// fail("Invalid exception type: "+error) -// } -// } -// -// test fun failingAssertWithLazyMessage() { -// val error = fails { -// assert(false) {"Hello"} -// } -// if(error is IllegalStateException) { -// assertEquals("Hello", error.getMessage()) -// } else { -// fail("Invalid exception type: "+error) -// } -// } + test fun passingAssert() { + assert(true) + var called = false + assert(true) { called = true; "some message" } + + assertFalse(called) + } + + test fun failingAssert() { + val assertDefaultMessage = "Assertion failed" + + val error = fails { + assert(false) + } + if(error is AssertionError) { + assertEquals(assertDefaultMessage, error.getMessage()) + } else { + fail("Invalid exception type: "+error) + } + } + + test fun passingAssertWithMessage() { + assert(true, "Hello") + } + + test fun failingAssertWithMessage() { + val error = fails { + assert(false, "Hello") + } + if(error is AssertionError) { + assertEquals("Hello", error.getMessage()) + } else { + fail("Invalid exception type: "+error) + } + } + + test fun failingAssertWithLazyMessage() { + val error = fails { + assert(false) {"Hello"} + } + if(error is AssertionError) { + assertEquals("Hello", error.getMessage()) + } else { + fail("Invalid exception type: "+error) + } + } } \ No newline at end of file diff --git a/libraries/stdlib/test/StandardCollectionTest.kt b/libraries/stdlib/test/StandardCollectionTest.kt index 83cba4a97f3..bb351f1f239 100644 --- a/libraries/stdlib/test/StandardCollectionTest.kt +++ b/libraries/stdlib/test/StandardCollectionTest.kt @@ -9,10 +9,8 @@ class StandardCollectionTest() : TestCase() { fun testDisabled() { } - /* fun testAny() { - // TODO requires KT-924 to be implemented - val data: Iterable = kotlin.util.arrayList("foo", "bar") + val data: Iterable = listOf("foo", "bar") assertTrue { data.any{it.startsWith("f")} @@ -21,5 +19,4 @@ class StandardCollectionTest() : TestCase() { data.any{it.startsWith("x")} } } - */ }