-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathtestsuite.exp
43 lines (40 loc) · 1.49 KB
/
testsuite.exp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
proc test {name regex} {
expect {
-re $regex { pass $name }
default { fail $name }
}
}
proc do_command {command result} {
test "prompt" ">"
send "$command\r"
test "autocompletion: $command" "[string range $command 3 1000]"
test $command $result
}
# Open the debug client.
set timeout 30
spawn swipl -f debug.pl
test "init" "From here you can go to the.*living room"
do_command "go to the living room" "cosy"
do_command "go to the kitchen" "From here"
do_command "take the gnome" "have the gnome"
do_command "open the oven" "is now open"
do_command "take the bread" "have the bread"
do_command "look at the bread" "durable"
do_command "put the gnome into the oven" "You place the gnome in"
#set timeout -1
do_command "close the oven" "close the oven"
do_command "turn on the oven" "gas streaming"
do_command "turn on the oven" "already"
do_command "turn off the oven" "turn the oven off"
do_command "turn off the oven" "already"
do_command "turn on the oven" "gas streaming"
do_command "open the oven" "gnome"
do_command "look at the oven" "streaming"
do_command "switch on the lighter" "on"
do_command "look at the lighter" "flame"
do_command "put the lighter into the oven" "ignites"
do_command "look" "gold"
do_command "look at the gold" "gold was inside"
test "prompt" ">"
# Shutdown.
close