# ----------------------------------------------------
# Test 07: test the interpreted if
# ----------------------------------------------------

!ifdef __UNIX__
mkerr=../cmds/mkerr
!else
mkerr=..\cmds\mkerr
!endif

.silent

tests = t08.001 t08.002 t08.003 t08.004 t08.005 &
        t08.006 t08.007 t08.008 t08.009 t08.010

all: .symbolic $(tests)
    rm t08.005
    rm t08.007


t08.001: .symbolic
    if a == b $(mkerr)
    if a== b $(mkerr)
    if a ==b $(mkerr)
    if a==b $(mkerr)


t08.002: .symbolic
    if not a == a $(mkerr)
    if not a== a $(mkerr)
    if not a ==a $(mkerr)
    if not a==a $(mkerr)


t08.003: .symbolic
    %create t08.003
    if not exist t08.003 $(mkerr)
    rm t08.003
    if exist t08.003 $(mkerr)


t08.004: .symbolic
    %create t08.004
    if not exist pre*.004 $(mkerr)
    rm t08.004


t08.005:
    if a == a if a== a if a ==a if a==a %create t08.005


t08.006: .symbolic
    $(mkerr) 0
    if errorlevel 1 $(mkerr)
    -$(mkerr) 1
    if not errorlevel 1 $(mkerr)
    if errorlevel 2 $(mkerr)


t08.007:
    if a        ==      a       %create t08.007


t08.008: .symbolic
    echo you should get 11 syntax errors now
    -if
    -if a
    -if a ==
    -if a==
    -if a ==a
    -if a== a
    -if a == a
    -if a =
    -if a=
    -if ==
    -if =


t08.009: .symbolic
    echo you should get 11 syntax errors now
    -if not
    -if not a
    -if not a ==
    -if not a==
    -if not a ==a
    -if not a== a
    -if not a == a
    -if not a =
    -if not a=
    -if not ==
    -if not =


t08.010: .symbolic
    echo you should get 8 syntax errors now
    -if errorlevel
    -if errorlevel 0
    -if not errorlevel
    -if not errorlevel 0
    -if exist
    -if exist a
    -if not exist
    -if not exist a
