diff --git a/src/test/cases/BasicTestCase.hx b/src/test/cases/BasicTestCase.hx index 74e902f..e955aa5 100644 --- a/src/test/cases/BasicTestCase.hx +++ b/src/test/cases/BasicTestCase.hx @@ -156,10 +156,7 @@ class BasicTestCase extends Test { } function testCond() { - Assert.equals("this one", BasicTestCase.myCond1); - Assert.equals("the default", BasicTestCase.myCond2); - Assert.equals("this", BasicTestCase.myCond3); - Assert.equals(null, BasicTestCase.myCondFallthrough); + _testCond(); } function testSetAndDeflocal() { diff --git a/src/test/cases/BasicTestCase.kiss b/src/test/cases/BasicTestCase.kiss index 2ee4905..7c0e764 100644 --- a/src/test/cases/BasicTestCase.kiss +++ b/src/test/cases/BasicTestCase.kiss @@ -153,24 +153,26 @@ (var myConstructedString (new String "sup")) -(var myCond1 (cond - ((= 5 6) "not this") - ((= 8 9) "not this either") - ((= 1 1) "this one") - (true "not the default"))) - -(var myCond2 (cond - ((= 5 6) "not this") - ((= 8 9) "not this either") - ((= 2 1) "not the third one") - (true "the default"))) - -(var myCond3 (cond - ((= 5 5) "this") - (true "default"))) - -(var myCondFallthrough (cond - (false "not this"))) +(function _testCond [] + (Assert.equals "this one" + (cond + ((= 5 6) "not this") + ((= 8 9) "not this either") + ((= 1 1) "this one") + (true "not the default"))) + (Assert.equals "the default" + (cond + ((= 5 6) "not this") + ((= 8 9) "not this either") + ((= 2 1) "not the third one") + (true "the default"))) + (Assert.equals "this" + (cond + ((= 5 5) "this") + (true "default"))) + (Assert.equals null + (cond + (false "not this")))) (function _testOr [] (Assert.equals 5 (or null 5))