Skip to content

Commit

Permalink
test for half-open infinite ranges like range('(5..') fails
Browse files Browse the repository at this point in the history
  • Loading branch information
pkrumins committed Oct 26, 2010
1 parent d1b9a76 commit 3ca02a9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions test/range.js
Expand Up @@ -22,6 +22,19 @@ exports['infinite range'] = function (assert) {
}, 2000);
}

exports['infinite range half-open'] = function (assert) {
var joinExecuted = false;
Lazy.range('(10..').take(10).join(function (xs) {
joinExecuted = true;
assert.deepEqual(xs, range(11, 21));
assert.equal(xs.length, 10);
});

setTimeout(function () {
assert.ok(joinExecuted, 'join didn\'t execute');
}, 2000);
}

exports['range i'] = function (assert) {
var joinExecuted = false;
Lazy.range(10).join(function (xs) {
Expand Down

0 comments on commit 3ca02a9

Please sign in to comment.