 
 testall_empty = ->
   run = false
-  Q.all([]).then ->
+  Q.all([]).then -> run = true
+  assert(run)
+
+testtimeout = ->
+  run = false
+  d = Q.defer()
+  timeoutPromise = Q.timeout(d.promise, 50)
+  timeoutPromise.then (s, f) ->
+    assert f is 'timeout'
     run = true
-  assert(run)
+  setTimeout (-> assert not run), 49
+  setTimeout (-> assert run), 51
 
 test()
 

  d = Q.defer()
  count = 0
  increment = -> count++
  d.promise.then((s, f) ->
    assert(s == 1)
    increment()
  )
  assert(count == 0)
  assert(d.success(1))
  assert(count == 1)

  testhello_fail()
  testoutoforder()
  testreturnpromise()
  testtimeout()

assert = (value) =>
  unless value
