From 188206bd546b5d6e62f483be6940a3826ac1ee43 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Tue, 13 Jan 2015 22:38:40 -0800 Subject: 558 - more chessboard tests --- chessboard-cursor.arc.t | 39 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 38 insertions(+), 1 deletion(-) (limited to 'chessboard-cursor.arc.t') diff --git a/chessboard-cursor.arc.t b/chessboard-cursor.arc.t index a3edfab0..d52183a2 100644 --- a/chessboard-cursor.arc.t +++ b/chessboard-cursor.arc.t @@ -29,8 +29,8 @@ ;? (= dump-trace* (obj whitelist '("schedule"))) (run 'main) (each routine completed-routines* +;? (prn " " routine) (awhen rep.routine!error -;? (prn " " r) (prn "error - " it))) (if (~ran-to-completion 'read-move) (prn "F - chessboard accepts legal moves (-)")) @@ -80,3 +80,40 @@ (prn "F - chessboard quits on move starting with 'q'")) (reset) +(new-trace "read-illegal-file") +(add-code:readfile "chessboard-cursor.mu") +(add-code + '((function! main [ + (default-space:space-address <- new space:literal 30:literal/capacity) + (1:channel-address/raw <- init-channel 3:literal) + (r:integer/routine <- fork-helper read-file:fn nil:literal/globals nil:literal/limit) + (c:character <- copy ((#\i literal))) + (x:tagged-value <- save-type c:character) + (1:channel-address/raw/deref <- write 1:channel-address/raw x:tagged-value) + (sleep until-routine-done:literal r:integer/routine) + ]))) +;? (= dump-trace* (obj whitelist '("schedule"))) +(run 'main) +;? (each routine completed-routines* +;? (prn " " routine)) +(if (ran-to-completion 'read-file) + (prn "F - 'read-file' checks that file lies between 'a' and 'h'")) + +(reset) +(new-trace "read-illegal-rank") +(add-code:readfile "chessboard-cursor.mu") +(add-code + '((function! main [ + (default-space:space-address <- new space:literal 30:literal/capacity) + (1:channel-address/raw <- init-channel 3:literal) + (r:integer/routine <- fork-helper read-rank:fn nil:literal/globals nil:literal/limit) + (c:character <- copy ((#\9 literal))) + (x:tagged-value <- save-type c:character) + (1:channel-address/raw/deref <- write 1:channel-address/raw x:tagged-value) + (sleep until-routine-done:literal r:integer/routine) + ]))) +(run 'main) +(if (ran-to-completion 'read-rank) + (prn "F - 'read-rank' checks that rank lies between '1' and '8'")) + +(reset) -- cgit 1.4.1-2-gfad0