example.lsp runs on Linux and Windows

This commit is contained in:
HAYAMA_Kaoru
2024-11-30 11:22:43 +09:00
parent cf747dcac7
commit b0efed751b
+9 -4
View File
@@ -1,23 +1,28 @@
(spawn "cmd.exe") (if (equal (getenv "OS") "Windows_NT")
(let ((ctrlc (format nil "~A" (convert 3 <character>)))) (spawn "cmd.exe" "/k" "set PROMPT=$$$S")
(spawn "bash"))
(defglobal ctrlc (format nil "~A" (convert 3 <character>)))
(block main (block main
(while t (while t
(expect* (expect*
("xxx" ("xxx"
(send ctrlc) (send ctrlc)
(expect "$ ")
(sendln "exit") (sendln "exit")
(return-from main nil) (return-from main nil)
) )
(("yyy" "zzz") (("yyy" "zzz")
(send ctrlc) (send ctrlc)
(sendln "rem") (expect "$ ")
(sendln "echo test")
) )
(10 ; timeout second (10 ; timeout second
(send ctrlc) (send ctrlc)
(expect "$ ")
(sendln "exit") (sendln "exit")
(return-from main nil) (return-from main nil)
) )
) )
) )
) )
)