Skip to content

Commit

Permalink
failing test for i param
Browse files Browse the repository at this point in the history
  • Loading branch information
James Halliday committed Jun 8, 2012
1 parent b0a752e commit 123d4d6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,13 @@ var test = require('tap').test;

test('empty or not', function (t) {
var xs = [ 1, 2, 3, 4, 5, 6 ];
var ys = concatMap(xs, function (x) {
var ixes = [];
var ys = concatMap(xs, function (x, ix) {
ixes.push(ix);
return x % 2 ? [ x - 0.1, x, x + 0.1 ] : [];
});
t.same(ys, [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]);
t.same(ixes, [ 0, 1, 2, 3, 4, 5 ]);
t.end();
});

Expand Down

0 comments on commit 123d4d6

Please sign in to comment.