mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-04-11 03:00:13 -04:00
tests are now passing on symbology
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
a: b: d: true
|
||||
c: false
|
||||
a = b = d = true
|
||||
c = false
|
||||
|
||||
result: if a
|
||||
result = if a
|
||||
if b
|
||||
if c then false else
|
||||
if d
|
||||
@@ -10,13 +10,13 @@ result: if a
|
||||
ok result
|
||||
|
||||
|
||||
first: if false then false else second: if false then false else true
|
||||
first = if false then false else second = if false then false else true
|
||||
|
||||
ok first
|
||||
ok second
|
||||
|
||||
|
||||
result: if false
|
||||
result = if false
|
||||
false
|
||||
else if NaN
|
||||
false
|
||||
@@ -27,7 +27,7 @@ ok result
|
||||
|
||||
|
||||
# Testing unless.
|
||||
result: unless true
|
||||
result = unless true
|
||||
10
|
||||
else
|
||||
11
|
||||
@@ -36,24 +36,24 @@ ok result is 11
|
||||
|
||||
|
||||
# Nested inline if statements.
|
||||
echo: (x) -> x
|
||||
result: if true then echo((if false then 'xxx' else 'y') + 'a')
|
||||
echo = (x) -> x
|
||||
result = if true then echo((if false then 'xxx' else 'y') + 'a')
|
||||
ok result is 'ya'
|
||||
|
||||
|
||||
# Testing inline funcs with inline if-elses.
|
||||
func: -> if 1 < 0.5 then 1 else -1
|
||||
func = -> if 1 < 0.5 then 1 else -1
|
||||
ok func() is -1
|
||||
|
||||
|
||||
# Testing empty or commented if statements ... should compile:
|
||||
result: if false
|
||||
result = if false
|
||||
else if false
|
||||
else
|
||||
|
||||
ok result is undefined
|
||||
|
||||
result: if false
|
||||
result = if false
|
||||
# comment
|
||||
else if true
|
||||
# comment
|
||||
@@ -63,7 +63,7 @@ ok result is undefined
|
||||
|
||||
|
||||
# Return an if with no else.
|
||||
func: ->
|
||||
func = ->
|
||||
return (if false then callback())
|
||||
|
||||
ok func() is null
|
||||
|
||||
Reference in New Issue
Block a user