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 # silly workaround for spec test format - change # comment to %
27 bind -p | grep vi-subst | sed 's/^#/%/'
28 echo
29
30 bind -P | grep vi-subst
31
32 ## STDOUT:
33 % vi-subst (not bound)
34
35 vi-subst is not bound to any keys
36 ## END
37
38 #### bind -s -S accepted
39
40 # TODO: add non-trivial tests here
41
42 bind -s
43 bind -S
44
45 ## STDOUT:
46 ## END
47
48 #### bind -v -V accepted
49
50 bind -v | grep blink-matching-paren
51 echo
52
53 # transform silly quote so we don't mess up syntax highlighting
54 bind -V | grep blink-matching-paren | sed "s/\`/'/g"
55
56 ## STDOUT:
57 set blink-matching-paren off
58
59 blink-matching-paren is set to 'off'
60 ## END
61
62 #### bind -q
63
64 bind -q zz-bad
65 echo status=$?
66
67 # bash prints message to stdout
68
69 bind -q vi-subst
70 echo status=$?
71
72 bind -q yank
73 echo status=$?
74
75 ## STDOUT:
76 status=1
77 vi-subst is not bound to any keys.
78 status=1
79 yank can be invoked via "\C-y".
80 status=0
81 ## END