1
0
Fork 0
mirror of https://github.com/jashkenas/coffeescript.git synced 2022-11-09 12:23:24 -05:00

fixed/removed broken/redundant tests

This commit is contained in:
satyr 2010-10-21 12:45:50 +09:00
parent 31746ce692
commit cb9683a7fd
2 changed files with 4 additions and 14 deletions

View file

@ -26,7 +26,9 @@ ok object is extend object, array
eq object[3], 3 eq object[3], 3
# Test `flatten` # 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` # Test `del`
eq 1, del object, 1 eq 1, del object, 1

View file

@ -23,23 +23,11 @@ func = (num) ->
true true
when 1, 3, 5 when 1, 3, 5
false false
else false
ok func(2) ok func(2)
ok func(6) ok func(6)
ok !func(3) ok !func(3)
ok !func(8) eq func(8), undefined
# 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
# Ensure that trailing switch elses don't get rewritten. # Ensure that trailing switch elses don't get rewritten.