summaryrefslogtreecommitdiffstats
path: root/test/config
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:14:42 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-28 09:14:42 +0000
commit0bc58b66a4850cdb8458a86c3d9a2fc81de82aa3 (patch)
treeea0fe36eb5e6f40e0a1f765d44c4b0c0b2bfb089 /test/config
parentInitial commit. (diff)
downloadbash-completion-upstream.tar.xz
bash-completion-upstream.zip
Adding upstream version 1:2.11.upstream/1%2.11upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--test/config/bashrc62
-rw-r--r--test/config/inputrc22
2 files changed, 84 insertions, 0 deletions
diff --git a/test/config/bashrc b/test/config/bashrc
new file mode 100644
index 0000000..141dddc
--- /dev/null
+++ b/test/config/bashrc
@@ -0,0 +1,62 @@
+# bashrc file for bash-completion test suite
+
+# Note that we do some initialization that would be too late to do here in
+# conftest.py.
+
+# Use emacs key bindings
+set -o emacs
+
+# Use bash strict mode
+set -o posix
+
+# Raise error on uninitialized variables
+set -o nounset
+
+# Unset `command_not_found_handle' as defined on Debian/Ubuntu, because this
+# troubles and slows down testing
+unset -f command_not_found_handle
+
+TESTDIR=$(pwd)
+
+export PS2='> '
+
+# Also test completions of system administrator commands, which are
+# installed via the same PATH expansion in `bash_completion.have()'
+export PATH=$PATH:/sbin:/usr/sbin:/usr/local/sbin
+
+# ...as well as games on some systems not in PATH by default:
+export PATH=$PATH:/usr/games:/usr/local/games
+
+# For clean test state, avoid sourcing user's ~/.bash_completion
+export BASH_COMPLETION_USER_FILE=/dev/null
+
+# ...and avoid stuff in BASH_COMPLETION_USER_DIR and system install locations
+# overriding in-tree completions. Setting the user dir would otherwise suffice,
+# but simple xspec completions are only installed if a separate one is not
+# found in any completion dirs. Therefore we also point the "system" dirs to
+# locations that should not yield valid completions and helpers paths either.
+export BASH_COMPLETION_USER_DIR=$(
+ cd "$SRCDIR/.." || exit 1
+ pwd
+)
+# /var/empty isn't necessarily actually always empty :P
+export BASH_COMPLETION_COMPAT_DIR=/var/empty/bash_completion.d
+export XDG_DATA_DIRS=/var/empty
+
+# Make sure default settings are in effect
+unset -v \
+ COMP_CONFIGURE_HINTS \
+ COMP_CVS_REMOTE \
+ COMP_KNOWN_HOSTS_WITH_HOSTFILE \
+ COMP_TAR_INTERNAL_PATHS
+
+# @param $1 Char to add to $COMP_WORDBREAKS
+add_comp_wordbreak_char()
+{
+ [[ "${COMP_WORDBREAKS//[^$1]/}" ]] || COMP_WORDBREAKS+=$1
+}
+
+# Local variables:
+# mode: shell-script
+# End:
+# ex: filetype=sh
diff --git a/test/config/inputrc b/test/config/inputrc
new file mode 100644
index 0000000..da896f5
--- /dev/null
+++ b/test/config/inputrc
@@ -0,0 +1,22 @@
+# Readline init file for bash-completion test suite
+# See: info readline
+
+# Press TAB once (instead of twice) to auto-complete
+set show-all-if-ambiguous on
+
+# No bell. No ^G in output
+set bell-style none
+
+# Don't query user about viewing the number of possible completions
+set completion-query-items -1
+
+# Don't use pager when showing completions
+set page-completions off
+
+# Print each completion on its own line
+set completion-display-width 0
+
+# Local variables:
+# mode: shell-script
+# End:
+# ex: filetype=sh