Permalink
Browse files

and another regtest to test the finer points of continue / break

  • Loading branch information...
maxtaco committed Dec 3, 2011
1 parent 42690b1 commit 3fb2f51aa04e5fb9d30cb7675916e313f14f2e57
Showing with 11 additions and 0 deletions.
  1. +11 −0 test/tame.coffee
View
@@ -1,4 +1,7 @@
+delay = (cb) ->
+ setTimeout cb, 10
+
atest "basic tame waiting", (cb) ->
i = 1
await setTimeout(defer(), 10)
@@ -29,4 +32,12 @@ atest "basic tame set structs", (cb) ->
field = "bar" # change the field to make sure that we captured "yo"
cb(obj.cat.yo == i, {})
+atest "continue / brek test" , (cb) ->
+ tot = 0
+ for i in [0..100]
+ await delay defer()
+ continue if i == 3
+ tot += i
+ break if i == 10
+ cb(tot == 52, {})

0 comments on commit 3fb2f51

Please sign in to comment.