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:
parent
782bc6c03a
commit
6832dda2fa
1 changed files with 7 additions and 24 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue