!
!  Purpose: Test the PAUSE intrinsic
!   Author: Matthew Harrell
!  Version: $Id: test_pause.mm,v 1.5 2009/08/04 19:15:57 jwb Exp $
!------------------------------------------------------------------------------ 
startmacro

  switch INTERACTIVE interAct GET DEF=TRUE

  if interAct then
    call pauseBasic
    call pauseNeg2
  else
    ! This is only an interactive test
  endif
  
  
endmacro


!
!  test basic pause capability
!
procedure pauseBasic
  set pauseVal 2
  say "Does this test pause for ^pauseVal seconds? "
  pause pauseVal
  ask s:yesNo "[Y]"
  assert/text="PAUSE: testing whether pause works" yesNo eqss "Y"
return

!**************************************************************************
!  test val of -2 (pause at each line and wait for RETURN) (BUG 1903)
!
procedure pauseNeg2
  
  say "Hit several random keys. The only key that should exit the pause below is ENTER."
  pause -2
  say "Did you have to hit ENTER to see this text?"
  ask s:yesNo "[Y]"
  assert/text="PAUSE: testing whether pause (-2) works" yesNo eqss "Y"
  
return
