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