#!../src/tops  -s ../sys  -u ../usr

#!/usr/local/bin/tops

# File batchtest

# Run this to make sure new changes don't break existing behavior.

"keyboard" missing IF halt THEN

" Batch test" . nl

\ Test that ukey.v is independent of key.v:
ercnt 
" ukey.v independent of key.v:" . nl (no key.v is present in batch)
"   file: " . "ukey.v" filefound drop . nl
"ukey.v" source \ check that my ukey.v is independent of key.v
ercnt = IF " Ok" ELSE " Error" THEN . nl


\ This test should be last, since it exits the program.
\ Test that key.v can be loaded in batch:
{"

   nl(dot(nl, " Test loading key.v in batch:"));
   catmsg(no);

   macro("'do_dot' SLEEP nl bye", "do_done");
   ALARM(5, "do_done" );

   macro("'.' dot", "do_dot");
   TASK(1, "do_dot");

   macro("'Exit in about 5 seconds .' dot 'do_dot' WAKE", "A");
   ALARM(0.5, "A" );

   source("key.v");


"} >> parse << main
