1 ## oils_failures_allowed: 1
2 ## compare_shells: bash
3
4 # NB: This is only for NON-interactive tests of bind.
5 # See spec/stateful/bind.py for the remaining tests.
6
7 #### bind -l should report readline functions
8
9 # This test depends on the exact version
10
11 # bind -l | sort > _tmp/this-shell-bind-l.txt
12 # comm -23 $REPO_ROOT/spec/testdata/bind/bind_l_function_list.txt _tmp/this-shell-bind-l.txt
13
14 # More relaxed test
15 bind -l | grep accept-line
16
17 ## status: 0
18 ## STDOUT:
19 accept-line
20 ## END
21
22
23 #### bind -p -P to print function names and key bindings
24
25 bind -p | grep menu-complete-backward
26 echo
27
28 bind -P | grep menu-complete-backward
29
30 ## STDOUT:
31 "\C-p": menu-complete-backward
32
33 menu-complete-backward can be found on "\C-p".
34 ## END
35
36 #### bind -s -S accepted
37
38 # TODO: add non-trivial tests here
39
40 bind -s
41 bind -S
42
43 ## STDOUT:
44 ## END
45
46 #### bind -v -V accepted
47
48 bind -v | grep blink-matching-paren
49 echo
50
51 # transform silly quote so we don't mess up syntax highlighting
52 bind -V | grep blink-matching-paren | sed "s/\`/'/g"
53
54 ## STDOUT:
55 set blink-matching-paren off
56
57 blink-matching-paren is set to 'off'
58 ## END
59
60 #### bind -q
61
62 bind -q zz-bad
63 echo status=$?
64
65 # bash prints message to stdout
66
67 bind -q vi-subst
68 echo status=$?
69
70 bind -q menu-complete
71 echo status=$?
72
73 ## STDOUT:
74 status=1
75 vi-subst is not bound to any keys.
76 status=1
77 menu-complete can be invoked via "\C-n".
78 status=0
79 ## END