Updating package.json to include Mocha.

This commit is contained in:
Elf M. Sternberg 2015-06-22 19:46:18 -07:00
parent 54da8c6b65
commit cfb2c3c08b
2 changed files with 9 additions and 7 deletions

View File

@ -12,7 +12,8 @@
"devDependencies": { "devDependencies": {
"chai": "^2.0.0", "chai": "^2.0.0",
"mocha": "^2.1.0", "mocha": "^2.1.0",
"coffeelint": "1.9.*" "coffeelint": "1.9.*",
"mocha-jenkins-reporter": "^0.1.7"
}, },
"scripts": { "scripts": {
"test": "make test", "test": "make test",

View File

@ -15,7 +15,6 @@ reduce = (lst, iteratee, memo, context) ->
null null
memo memo
map = (lst, iteratee, context, count = 0) -> map = (lst, iteratee, context, count = 0) ->
return nil if nilp lst return nil if nilp lst
product = iteratee.call(context, (car lst), count, lst) product = iteratee.call(context, (car lst), count, lst)
@ -25,18 +24,20 @@ map = (lst, iteratee, context, count = 0) ->
rmap = (lst, iteratee, context, count = 0) -> rmap = (lst, iteratee, context, count = 0) ->
return nil if nilp lst return nil if nilp lst
product = (if (nilp cdr lst) then nil else rest = (if (nilp cdr lst) then nil else
map((cdr lst), iteratee, context, count + 1)) map((cdr lst), iteratee, context, count + 1))
cons product, iteratee.call(context, (car lst), count, lst) product = iteratee.call(context, (car lst), count, lst)
cons rest, product
reverse = (lst) -> rmap lst, (i) -> i
filter = (lst, iteratee, context) -> filter = (lst, iteratee, context) ->
return nil if nilp lst return nil if nilp lst
if iteratee.call(context, (car lst), lst) if iteratee.call(context, (car lst), lst)
cons (car lst), filter (cdr lst) cons (car lst), filter (cdr lst), iteratee, context
else else
filter (cdr list) filter (cdr list), iteratee, context
reverse = (lst) -> rmap lst, (i) -> i
module.exports = module.exports =
reduce: reduce reduce: reduce