! This is the scenarios file for the path primitive test. This file is used to
! introduce path changes to the initial path and to execute the testpathprim 
! primitive. It cannot be run standalone, it should be run as a child of the
! test_path_prim macro in order to observe the error.
!
!
! Bug:     1285
! Author:  Jim Roush
! Version: $Id: test_path_prim_scenarios.mm,v 1.3 2008/05/19 21:29:45 jxc Exp $
!
startmacro

  ! save previous path
  res savepath opt.path

  ! Verify that the testpathprim primitive is run from the MYTESTOPT1 option tree.
  res tree NONE
  testpathprim
  assert/text="Primitive running from the MYTESTOPT1 option tree" tree EQS "MYTESTOPT1"
 
  ! Add MYTESTOPT2 to the path and verify that the testpathprim primitive is run from
  ! the MYTESTOPT2 option tree.
  path add MYTESTOPT2
  res tree NONE
  testpathprim
  assert/text="Primitive running from the MYTESTOPT2 option tree" tree EQS "MYTESTOPT2"

  ! Add non-existant switch with ^ to primitive to force reparsing of commands in Macro.java.
  testpathprim/junktestswitch=^tree
  assert/text="Primitive running with a non-existant '^' switch" tree EQS "MYTESTOPT2"

  ! Remove MYTESTOPT2 from the path and verify that the testpathprim primitive is run
  ! from the preceding path member (MYTESTOPT1).
  path rem MYTESTOPT2
  res tree NONE
  testpathprim
  assert/text="Primitive running from the MYTESTOPT1 option tree" tree EQS "MYTESTOPT1"

! restore previous path
  path set ^savepath

endmacro
