Introduction
Introduction Statistics Contact Development Disclaimer Help
Add support for running interactive test with expect - clic - Clic is an comman…
git clone git://bitreich.org/clic/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65…
Log
Files
Refs
Tags
README
LICENSE
---
commit c2c3178142a5fec87b71d7e4f4b8b2d8fc5446c0
parent ba86c5e114249375116d7d40a5b66bc2e2baa4ce
Author: Solene Rapenne <[email protected]>
Date: Thu, 16 Nov 2017 12:08:14 +0000
Add support for running interactive test with expect
Diffstat:
A interactive-test.exp | 106 ++++++++++++++++++++++++++++++
M run-test.sh | 2 ++
2 files changed, 108 insertions(+), 0 deletions(-)
---
diff --git a/interactive-test.exp b/interactive-test.exp
@@ -0,0 +1,106 @@
+proc user_input {} {
+
+ expect "clic => "
+
+ send "garbage\n"
+ expect "clic => "
+ send ". . ~. ~ .\n"
+ expect "clic => "
+
+ send "r\n"
+ expect "clic => "
+
+ send "help\n"
+ expect "clic => "
+
+ send "5\n"
+ expect "clic => "
+
+ send "p\n"
+ expect "clic => "
+
+ send "19\n"
+ expect " : "
+
+ send "p\n"
+ expect "clic => "
+
+ send "h\n"
+ expect "clic => "
+
+ send "a\n"
+ expect "clic => "
+
+ send "b\n"
+ expect "clic => "
+}
+
+spawn ./clic gopher://bitreich.org
+set running [user_input]
+send "x\n"
+expect eof
+
+
+spawn sbcl
+expect "* "
+
+send "(require :sb-cover) (require :sb-bsd-sockets)\n"
+expect "* "
+
+send "(declaim (optimize sb-cover:store-coverage-data))\n"
+expect "* "
+
+send "(compile-file \"clic.lisp\")\n"
+expect "* "
+
+send "(load \"clic.fasl\")\n"
+expect "* "
+
+send "(setf *offline* t)\n"
+expect "* "
+
+send "(main)\n"
+set running [user_input]
+send "quit\n"
+expect "* "
+
+send "(main)\n"
+expect "clic => "
+
+send "q\n"
+expect "* "
+
+send "(pop *history*) (p) (r)\n"
+expect "* "
+
+
+# add an argv to test argv parsing
+send "(setf *posix-argv* '(\"sbcl\" \"gopher://bitreich.org/0/usr/\"))\n"
+expect "* "
+
+send "(main)\n"
+expect "* "
+
+
+# add an argv to test argv parsing
+send "(setf *posix-argv* '(\"sbcl\" \"bitreich.org/0/usr/\"))\n"
+expect "* "
+send "(main)\n"
+expect "* "
+
+
+
+# add an argv to test argv parsing
+send "(setf *posix-argv* '(\"sbcl\" \"bitreich.org:70/\"))\n"
+expect "* "
+send "(main)\n"
+expect "clic => "
+send "q\n"
+expect "* "
+
+
+send "(sb-cover:report \"report/\")\n"
+expect "* "
+
+send "(quit)\n"
+expect eof
diff --git a/run-test.sh b/run-test.sh
@@ -2,6 +2,8 @@
LISP=$1
+expect -f interactive-test.exp
+
${LISP} --load clic.lisp --load test.lisp
./clic gopher://bitreich.org:70/0/ | md5sum -
You are viewing proxied material from bitreich.org. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.