-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu__test.sh
More file actions
41 lines (39 loc) · 750 Bytes
/
menu__test.sh
File metadata and controls
41 lines (39 loc) · 750 Bytes
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
#!/usr/bin/expect -f
#export TERM=linux
# +
set KEY_UP \x2B
# uncomment \x20 or \x1b\[B lines if you want to use "-" or key_down
# if it does not work use autoexpect to find the right keys
# -
# set KEY_DOWN \x2D
# down arrow
set KEY_DOWN \x1b\[B
# >
set KEY_RIGHT \x3E
# <
set KEY_LEFT \x3C
set RETURN \r
set TAB \t
set NEXT_PAGE \x1b\[6~
set PREV_PAGE \x1b\[5~
set timeout -1
# exp_internal 1
spawn ./menu
# fill form
send -- "one"
send -- $KEY_DOWN
send -- "two"
send -- $RETURN
expect "arg1=one"
expect "arg2=two"
send -- $TAB
send -- $KEY_DOWN
send -- $KEY_DOWN
send -- $RETURN
sleep .5
expect "msg=3. Remember the sabbath day, to keep it holy."
send -- $KEY_RIGHT
send -- $KEY_RIGHT
sleep 3
send -- $RETURN
puts " seems to be OK"