From 01ca5588987a56be504d7c11666847d03007e30f Mon Sep 17 00:00:00 2001 From: James Strachan Date: Tue, 20 Mar 2012 16:15:42 +0000 Subject: [PATCH] re-enabled some more tests for check; still need KT-1540 fixed to be able to use the assert function though --- libraries/stdlib/test/PreconditionsTest.kt | 68 +++++++++++----------- 1 file changed, 34 insertions(+), 34 deletions(-) diff --git a/libraries/stdlib/test/PreconditionsTest.kt b/libraries/stdlib/test/PreconditionsTest.kt index 936c7dc8701..5229c533391 100644 --- a/libraries/stdlib/test/PreconditionsTest.kt +++ b/libraries/stdlib/test/PreconditionsTest.kt @@ -36,46 +36,46 @@ class PreconditionsTest() : TestCase() { } } -// TODO: uncomment when KT-1540 is resolved. -// fun testPassingCheck() { -// check1(true) -// } -// -// fun testFailingCheck() { -// val error = fails { -// check1(false) -// } -// if(error is IllegalStateException) { -// assertNull(error.getMessage()) -// } else { -// fail("Invalid exception type: "+error) -// } -// } -// -// fun testPassingCheckWithMessage() { -// check2(true, "Hello") -// } -// -// fun testFailingCheckWithMessage() { -// val error = fails { -// check2(false, "Hello") -// } -// if(error is IllegalStateException) { -// assertEquals("Hello", error.getMessage()) -// } else { -// fail("Invalid exception type: "+error) -// } -// } + fun testPassingCheck() { + check(true) + } + + fun testFailingCheck() { + val error = fails { + check(false) + } + if(error is IllegalStateException) { + assertNull(error.getMessage()) + } else { + fail("Invalid exception type: "+error) + } + } + + fun testPassingCheckWithMessage() { + check(true, "Hello") + } + + fun testFailingCheckWithMessage() { + val error = fails { + check(false, "Hello") + } + if(error is IllegalStateException) { + assertEquals("Hello", error.getMessage()) + } else { + fail("Invalid exception type: "+error) + } + } // TODO: uncomment when KT-1540 is resolved. // fun testPassingAssert() { -// assert1(true) +// assert(true) // } // +// // fun testFailingAssert() { // val error = fails { -// assert1(false) +// assert(false) // } // if(error is IllegalStateException) { // assertNull(error.getMessage()) @@ -85,12 +85,12 @@ class PreconditionsTest() : TestCase() { // } // // fun testPassingAssertWithMessage() { -// assert2(true, "Hello") +// assert(true, "Hello") // } // // fun testFailingAssertWithMessage() { // val error = fails { -// assert2(false, "Hello") +// assert(false, "Hello") // } // if(error is IllegalStateException) { // assertEquals("Hello", error.getMessage())