From cb9683a7fd99a9bf0d6652b00f2394bcc1f39307 Mon Sep 17 00:00:00 2001 From: satyr Date: Thu, 21 Oct 2010 12:45:50 +0900 Subject: [PATCH] fixed/removed broken/redundant tests --- test/test_helpers.coffee | 4 +++- test/test_switch.coffee | 14 +------------- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/test/test_helpers.coffee b/test/test_helpers.coffee index 6754b30a..c0d3c87b 100644 --- a/test/test_helpers.coffee +++ b/test/test_helpers.coffee @@ -26,7 +26,9 @@ ok object is extend object, array eq object[3], 3 # Test `flatten` -eq "#{ flatten [0, [1, 2], 3, [4]] }", "#{ array }" +ay = yes +(ay and= typeof n is 'number') for n in flatten [0, [[1], 2], 3, [4]] +ok ay # Test `del` eq 1, del object, 1 diff --git a/test/test_switch.coffee b/test/test_switch.coffee index f3307d9e..79616e20 100644 --- a/test/test_switch.coffee +++ b/test/test_switch.coffee @@ -23,23 +23,11 @@ func = (num) -> true when 1, 3, 5 false - else false ok func(2) ok func(6) ok !func(3) -ok !func(8) - - -# Should cache the switch value, if anything fancier than a literal. -num = 5 -result = switch num += 5 - when 5 then false - when 15 then false - when 10 then true - else false - -ok result +eq func(8), undefined # Ensure that trailing switch elses don't get rewritten.