! Tests for the LOOP and ENDLOOP commands.
!
! @author  J. Czechowski IV
! @version $Id: test_loop.mm,v 1.1 2007/07/24 15:35:29 jxc Exp $
!
startmacro
  set str "|"
  loop 10 i
    set str "^{str}^{i}|"
  endloop
  assert/text="^reg.main.name: LOOP 10 i" str eqs "|1|2|3|4|5|6|7|8|9|10|" and i eq 10

  set str "|"
  loop 5 i
    set str "^{str}^{i}|"
  endloop
  assert/text="^reg.main.name: LOOP 5 i" str eqs "|1|2|3|4|5|" and i eq 5

  ! COUNT<=0 is a special case in X-Midas
  set str "|"
  loop -5 i
    set str "^{str}^{i}|"
  endloop
  assert/text="^reg.main.name: LOOP -5 i" str eqs "|" and i eq 0

endmacro