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

improving/minimizing the provided test cases for #1014

This commit is contained in:
Michael Ficarra 2011-01-06 23:47:03 -05:00
parent 782bc6c03a
commit 6832dda2fa

View file

@ -76,27 +76,10 @@ test "large ranges are generated with looping constructs", ->
eq 99, up[len - 1]
test "#1014 slices with arguments object", ->
useArg0AtEnd = ->
ary = -> [0..arguments[0]]
ary 9
arg0End = useArg0AtEnd()
useArg0AtStart = ->
ary = -> [arguments[0]..9]
ary 0
arg0Start = useArg0AtStart()
useArgs0And1 = ->
ary = -> [arguments[0]..arguments[1]]
ary 0,9
args0And1 = useArgs0And1()
useArg0FromOuter = ->
ary = -> [arguments[0]..9]
ary(arguments[0])
arg0FromOuter = useArg0FromOuter(0)
arrayEq arg0End , shared
arrayEq arg0Start , shared
arrayEq args0And1 , shared
arrayEq arg0FromOuter , shared
expected = [0..9]
argsAtStart = (-> [arguments[0]..9]) 0
arrayEq expected, argsAtStart
argsAtEnd = (-> [0..arguments[0]]) 9
arrayEq expected, argsAtEnd
argsAtBoth = (-> [arguments[0]..arguments[1]]) 0, 9
arrayEq expected, argsAtBoth