Permalink
Browse files

more test cases

  • Loading branch information...
1 parent b8acda8 commit e2cd9339f6057bdcc63d22fa306d42be41336866 @maxtaco committed Dec 10, 2011
Showing with 12 additions and 4 deletions.
  1. +1 −1 TAME.md
  2. +11 −3 test/tame.coffee
View
@@ -99,7 +99,7 @@ Tranlsation Technique
---------------------
The CoffeeScript tame addition uses a simlar continuation-passing
-translation to *tamejs*, but it's been refined greatly. Here are
+translation to *tamejs*, but it's been refined. Here are
the general steps involved:
* **1** Run the standard CoffeeScript lexer, rewriter, and parser, with a
View
@@ -43,7 +43,7 @@ atest "continue / brek test" , (cb) ->
cb(tot == 52, {})
atest "for k,v of obj testing", (cb) ->
- obj = { the : "quick", brown : "fox", jumped : "over" };
+ obj = { the : "quick", brown : "fox", jumped : "over" }
s = ""
for k,v of obj
await delay defer()
@@ -77,11 +77,10 @@ atest "switch-a-roos", (cb) ->
else
res += i*1000
res += 10000 if i == 2
- console.log "logging #{res}"
cb( res == 17321, {} )
-atest "parallel awaits with buggy classes", (cb) ->
+atest "parallel awaits with classes", (cb) ->
class MyClass
constructor: ->
@val = 0
@@ -101,3 +100,12 @@ atest "parallel awaits with buggy classes", (cb) ->
v = obj.getVal()
cb(v == 14, {})
+atest "loop construct", (cb) ->
+ i = 0
+ loop
+ await delay defer()
+ i += 1
+ await delay defer()
+ break if i == 10
+ await delay defer()
+ cb(i == 10, {})

0 comments on commit e2cd933

Please sign in to comment.