! regression/common/checkreply - start
APROPOS APROPOS
! regression/common/checkreply "APROPOS" "md5:5aa490da295b5615f392eca7eec0bfab"
ALLOW KEY 1 1
! regression/common/checkreply "ALLOW" "304 O.K. 0 elements affected"
MAN unknownmanpage
! regression/common/checkreply "MAN" "303 O.K. Manpage displayed."
CAPTION honk
! regression/common/checkreply "CAPTION" "301 O.K."
CAPTION
! regression/common/checkreply "CAPTION usage" "501 Usage: CAPTION string"
ECHO
! regression/common/checkreply "ECHO" "501 Usage: ECHO string"
ECHO honk
! regression/common/checkreply "ECHO" "301 O.K."
HELP
! regression/common/checkreply "HELP" "500 HELP [MODULE|COMMAND|KEY|MOUSE|RENDERER|COROUTINE]."
QUITPROGRAM -1
! regression/common/checkreply "QUITPROGRAM" "303 O.K. New value QUITPROGRAM=-1"
WAITBARTITLE 0 10 honk
! regression/common/checkreply "WAITBARTITLE on" "303 O.K. Waitbartitle fixed."
WAITBARTITLE -1
! regression/common/checkreply "WAITBARTITLE off" "303 O.K. Normal waitbars"
FINDVOXEL i
! regression/common/checkreply "FINDVOXEL i" "303 O.K. Found at 0 0 0."
FINDVOXEL c 1
! regression/common/checkreply "FINDVOXEL c 1" "303 O.K. Found at 10 10 10."
FINDVOXEL c 1
! regression/common/checkreply "FINDVOXEL c 1" "303 O.K. Found at 11 10 10."
FINDVOXEL g 400 400
! regression/common/checkreply "FINDVOXEL g 400 400" "303 O.K. Found at 49 44 51."
FINDVOXEL d 8 8
! regression/common/checkreply "FINDVOXEL d 8 8" "504 Error: Not found."
FINDVOXEL i
! regression/common/checkreply "FINDVOXEL i" "303 O.K. Found at 0 0 0."
FINDVOXEL d 0 0
! regression/common/checkreply "FINDVOXEL d 0 0" "303 O.K. Found at 10 10 10."
FINDVOXEL d 1 1
! regression/common/checkreply "FINDVOXEL d 1 1" "303 O.K. Found at 90 10 10."
FINDVOXELCUBE d 0 0
! regression/common/checkreply "FINDVOXELCUBE d 0 0" "303 O.K. Cube (10 10 10)-(89 89 89)."
FINDVOXELCUBE c 1
! regression/common/checkreply "FINDVOXELCUBE c 1" "303 O.K. Cube (10 10 10)-(89 89 19)."
FINDVOXELCUBE c 3
! regression/common/checkreply "FINDVOXELCUBE c 3" "303 O.K. Cube (30 40 30)-(69 59 39)."
FINDVOXELCUBE g 400 400
! regression/common/checkreply "FINDVOXELCUBE g 400 400" "303 O.K. Cube (31 31 51)-(69 69 89)."

# ok - stop checking. The reason we use the long form "MACRO" here, is to
# make the regression check script shut up. If ! works, MACRO should work
# just as fine.
MACRO regression/common/checkreply - stop

#
# SCRIPTCACHE_FLUSH is a bit hard to check ...
#
# we check it by abusing the cache to serve an old version, then flush 
# and see when the result changes:
#
# Write a new file, flush the cache, so that it really gets cached.
# Note the silly quoting, so that it doesn't get executed on parse ...
DECLARE int $testvar
CECHO ${$testvar=42}
SCRIPTCACHE_FLUSH
SPAWNPROCESS echo 'CECHO $''{$parent.testvar=23}' >/tmp/regression.script
! /tmp/regression.script
IF ${$testvar==23} ! regression/common/sayok   "SCRIPTCACHE_FLUSH init"
ELSE               ! regression/common/sayfail "SCRIPTCACHE_FLUSH init"

# Write other version, don't flush yet. Should still exec old one.
SPAWNPROCESS echo 'CECHO $''{$parent.testvar=5+3}' >/tmp/regression.script
! /tmp/regression.script
IF ${$testvar==23} ! regression/common/sayok   "SCRIPTCACHE_FLUSH unflushed"
ELSE               ! regression/common/sayfail "SCRIPTCACHE_FLUSH unflushed"

# Now flush it - should now exec the new one.
SCRIPTCACHE_FLUSH
! /tmp/regression.script
CECHO ${$testvar}
IF ${$testvar==8} ! regression/common/sayok   "SCRIPTCACHE_FLUSH"
ELSE              ! regression/common/sayfail "SCRIPTCACHE_FLUSH"
SPAWNPROCESS rm /tmp/regression.script

# we use SCRIPT_OUTPUT all the time - so it should be ok. We place this here
# to keep the regression check script happy.
SCRIPT_OUTPUT .

SPAWNPROCESS echo honk >/tmp/regression
! regression/common/checkfile "SPAWNPROCESS" "/tmp/regression" "99e300cedfe681df76ffc7b678e88afa" delete

! regression/common/checkreply - start
REGISTER Regression Global Command REGRESSIONTEST Help 3 CECHO Regressiontest
! regression/common/checkreply "REGISTER" "303 O.K. Registered command handler."
REGRESSIONTEST
! regression/common/checkreply "REGRESSIONTEST" "303 O.K. Regressiontest"
RESFLAGS Regression Global Command 0
! regression/common/checkreply "RESFLAGS" "303 O.K. Flags changed"
REGRESSIONTEST
! regression/common/checkreply "REGRESSIONTEST" "505 Command not found:REGRESSIONTEST"
RESFLAGS Regression Global Command 1
! regression/common/checkreply "RESFLAGS" "303 O.K. Flags changed"
REGRESSIONTEST
! regression/common/checkreply "REGRESSIONTEST" "303 O.K. Regressiontest"
UNREGISTER Regression Global Command REGRESSIONTEST
! regression/common/checkreply "UNREGISTER" "303 O.K. Unregistered command handler."
REGRESSIONTEST
! regression/common/checkreply "REGRESSIONTEST" "505 Command not found:REGRESSIONTEST"
#
# Check the GETINPUT command - can't really check it thoroughly.
#
GETINPUT 0
! regression/common/checkreply "GETINPUT 0" "301 O.K."
! regression/common/checkreply - stop

QUIT
