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:
parent
31746ce692
commit
cb9683a7fd
2 changed files with 4 additions and 14 deletions
|
@ -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
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue