Permalink
Browse files

Added failing test: promise.wait() after promise.emitXXX()

  • Loading branch information...
1 parent 95fd370 commit 80ace36e4cb287c36b44c6b986c5e5dea2b1c825 @zimbatm zimbatm committed with ry Feb 15, 2010
Showing with 15 additions and 0 deletions.
  1. +15 −0 test/mjsunit/test-promise-wait.js
@@ -45,6 +45,9 @@ p5.addCallback(function () {
}, 100);
});
+var p6 = new events.Promise();
+var p7 = new events.Promise();
+p7.addErrback(function() {});
p2.emitSuccess();
@@ -74,6 +77,18 @@ assert.deepEqual(["a","b","c"], ret4);
assert.equal(true, p4_done);
+
+p6.emitSuccess("something");
+assert.equal("something", p6.wait());
+p7.emitError("argh!");
+var goterr;
+try {
+ p7.wait();
+} catch(err) {
+ goterr = err;
+}
+assert.equal("argh!", goterr.toString());
+
process.addListener("exit", function () {
assert.equal(true, p1_done);
assert.equal(true, p2_done);

0 comments on commit 80ace36

Please sign in to comment.