   eq nonce, result
 
 
-# For / While / Until / Loop
-
-# TODO: refactor while tests
-
-# While
-
-i = 5
-list = while i -= 1
-  i * 2
-ok list.join(' ') is "8 6 4 2"
-
-i = 5
-list = (i * 3 while i -= 1)
-ok list.join(' ') is "12 9 6 3"
-
-i = 5
-func   = (num) -> i -= num
-assert = -> ok i < 5 > 0
-results = while func 1
-  assert()
-  i
-ok results.join(' ') is '4 3 2 1'
-
-i = 10
-results = while i -= 1 when i % 2 is 0
-  i * 2
-ok results.join(' ') is '16 12 8 4'
-
-#759: `if` within `while` condition
-2 while if 1 then 0
+test "basic `while` loops", ->
+
+  i = 5
+  list = while i -= 1
+    i * 2
+  ok list.join(' ') is "8 6 4 2"
+
+  i = 5
+  list = (i * 3 while i -= 1)
+  ok list.join(' ') is "12 9 6 3"
+
+  i = 5
+  func   = (num) -> i -= num
+  assert = -> ok i < 5 > 0
+  results = while func 1
+    assert()
+    i
+  ok results.join(' ') is '4 3 2 1'
+
+  i = 10
+  results = while i -= 1 when i % 2 is 0
+    i * 2
+  ok results.join(' ') is '16 12 8 4'
+
+
+test "Issue 759: `if` within `while` condition", ->
+
+  2 while if 1 then 0
+
 
 test "assignment inside the condition of a `while` loop", ->
+
   nonce = {}
   count = 1
   a = nonce while count--

    b = nonce
  eq nonce, b

# While over break.
i = 0
result = while i < 10
  i++
  break
arrayEq result, []

# While over continue.
i = 0
result = while i < 10
  i++
  continue
arrayEq result, []

# Until

# TODO: refactor until tests
# TODO: add until tests

value = false
i = 0
results = until value
  value = true if i is 5
  i++
ok i is 6

# Loop

# TODO: refactor loop tests
# TODO: add loop tests

i = 5
list = []
loop
  i -= 1
  break if i is 0
  list.push i * 2
ok list.join(' ') is '8 6 4 2'

# TODO: refactor for tests
# TODO: add for tests

test "break at the top level", ->
  for i in [1,2,3]

  eq 2, someFunc()


test "basic `switch`", ->

  num = 10
  result = switch num
    when 5 then false
    when 'a'
      true
      true
      false
    when 10 then true


    # Mid-switch comment with whitespace
    # and multi line
    when 11 then false
    else false

  ok result


  func = (num) ->
    switch num
      when 2, 4, 6
        true
      when 1, 3, 5
        false

  ok func(2)
  ok func(6)
  ok !func(3)
  eq func(8), undefined


test "Ensure that trailing switch elses don't get rewritten.", ->

  result = false
  switch "word"
    when "one thing"
      doSomething()
    else
      result = true unless false

  ok result

  result = false
  switch "word"
    when "one thing"
      doSomething()
    when "other thing"
      doSomething()
    else
      result = true unless false

  ok result


test "Should be able to handle switches sans-condition.", ->

  result = switch
    when null                     then 0
    when !1                       then 1
    when '' not of {''}           then 2
    when [] not instanceof Array  then 3
    when true is false            then 4
    when 'x' < 'y' > 'z'          then 5
    when 'a' in ['b', 'c']        then 6
    when 'd' in (['e', 'f'])      then 7
    else ok

  eq result, ok


test "Should be able to use `@properties` within the switch clause.", ->

  obj = {
    num: 101
    func: ->
      switch @num
        when 101 then '101!'
        else 'other'
  }

  ok obj.func() is '101!'


test "Should be able to use `@properties` within the switch cases.", ->

  obj = {
    num: 101
    func: (yesOrNo) ->
      result = switch yesOrNo
        when yes then @num
        else 'other'
      result
  }

  ok obj.func(yes) is 101


test "Switch with break as the return value of a loop.", ->

  i = 10
  results = while i > 0
    i--
    switch i % 2
      when 1 then i
      when 0 then break

  eq results.join(', '), '9, , 7, , 5, , 3, , 1, '


test "Issue #997. Switch doesn't fallthrough.", ->

  val = 1
  switch true
    when true
      if false
        return 5
    else
      val = 2

  eq val, 1
