| 1 |
## oils_failures_allowed: 0
|
| 2 |
## oils_cpp_failures_allowed: 4
|
| 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 |
|
| 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 |
|
| 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 |
|
| 39 |
|
| 40 |
# TODO: add non-trivial tests here
|
| 41 |
|
| 42 |
bind -s
|
| 43 |
bind -S
|
| 44 |
|
| 45 |
## STDOUT:
|
| 46 |
## END
|
| 47 |
|
| 48 |
|
| 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 |
|
| 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
|
| 82 |
|
| 83 |
|
| 84 |
|
| 85 |
bind -q yank | grep -oF '\C-o\C-s\C-h'
|
| 86 |
echo status=$?
|
| 87 |
|
| 88 |
bind '"\C-o\C-s\C-h": yank'
|
| 89 |
bind -q yank | grep -oF '\C-o\C-s\C-h'
|
| 90 |
echo status=$?
|
| 91 |
|
| 92 |
bind -r "\C-o\C-s\C-h"
|
| 93 |
bind -q yank | grep -oF '\C-o\C-s\C-h'
|
| 94 |
echo status=$?
|
| 95 |
|
| 96 |
## STDOUT:
|
| 97 |
status=1
|
| 98 |
\C-o\C-s\C-h
|
| 99 |
status=0
|
| 100 |
status=1
|
| 101 |
## END
|