From cf4b5fc52a5614e341f6e0cb3988fda6e88170e9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Geisend=C3=B6rfer?= Date: Wed, 8 Sep 2010 07:34:21 +0200 Subject: [PATCH] Test case showing a bug in nextTick ordering nextTick should fire before setTimeout in this test, but it doesn't. --- test/simple/test-next-tick-ordering2.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test/simple/test-next-tick-ordering2.js diff --git a/test/simple/test-next-tick-ordering2.js b/test/simple/test-next-tick-ordering2.js new file mode 100644 index 0000000000..2e7e0d1d37 --- /dev/null +++ b/test/simple/test-next-tick-ordering2.js @@ -0,0 +1,17 @@ +common = require("../common"); +assert = common.assert + +var order = []; +process.nextTick(function () { + process.nextTick(function() { + order.push('nextTick'); + }); + + setTimeout(function() { + order.push('setTimeout'); + }, 0); +}) + +process.addListener('exit', function () { + assert.deepEqual(order, ['nextTick', 'setTimeout']); +});