Permalink
Browse files

this test broke my world

  • Loading branch information...
1 parent bf3ec76 commit fd041e1598b3812065c26c7951aa2a984451dddf @maxtaco committed Dec 13, 2011
Showing with 17 additions and 2 deletions.
  1. +17 −2 test/tame.coffee
View
@@ -146,7 +146,7 @@ atest "test nested serial/parallel", (cb) ->
ok = false unless slots[i]
cb(ok, {})
-atest "AT variable works in an await", (cb) ->
+atest "AT variable works in an await (1)", (cb) ->
class MyClass
constructor : ->
@flag = false
@@ -158,7 +158,22 @@ atest "AT variable works in an await", (cb) ->
getFlag : -> @flag
o = new MyClass
await o.run defer()
- cb(true, {})
+ cb(o.getFlag(), {})
+
+atest "AT variable works in an await (2)", (cb) ->
+ class MyClass
+ constructor : -> @val = 0
+ inc : -> @val++
+ chill : (autocb) -> await delay defer()
+ run : (autocb) ->
+ await @chill defer()
+ for i in [0..10]
+ await @chill defer()
+ @inc()
+ getVal : -> @val
+ o = new MyClass
+ await o.run defer()
+ cb(o.getVal() == 10, {})
atest "more advanced autocb test", (cb) ->
bar = -> "yoyo"

0 comments on commit fd041e1

Please sign in to comment.