Permalink
Browse files

failing inner timeout test

  • Loading branch information...
1 parent 863defd commit a60d19892800daacbffa49977187b815f390e441 @substack committed Jan 14, 2012
Showing with 20 additions and 1 deletion.
  1. +20 −1 test/discard.js
View
@@ -15,7 +15,7 @@ test('errors', function (t) {
}));
});
-test('busy timeout', function (t) {
+test('outer timeout', function (t) {
t.plan(1);
var tt = toss(15, function (err) {
t.equal(err.toString(), 'Error: timeout');
@@ -29,6 +29,25 @@ test('busy timeout', function (t) {
}));
});
+test('inner timeout', function (t) {
+ t.plan(1);
+ var times = 0;
+ var tt = toss(function (err) {
+ if (++times === 1) {
+ t.equal(err.toString(), 'Error: timeout');
+ }
+ else {
+ t.end();
+ }
+ });
+
+ busy(5, tt(function () {
+ busy(tt(function () {
+ tt.end();
+ }))
+ }));
+});
+
function busy (cb) {
setTimeout(cb, 10);
}

0 comments on commit a60d198

Please sign in to comment.