Skip to content

Commit 89ef647

Browse files
committed
Add more tests
Hopefully, this helps us catch more missing functionality.
1 parent fc161dc commit 89ef647

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed

Diff for: .test/config.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/usr/bin/env bash
2+
3+
# https://github.com/docker-library/official-images/blob/618a85a87796c8bbea059011d94d888dc7554158/test/config.sh
4+
5+
imageTests+=(
6+
[bash]='bash-optional-features'
7+
)

Diff for: .test/tests/bash-optional-features/run.sh

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
#!/usr/bin/env bash
2+
set -Eeuo pipefail
3+
4+
# there's a lot of commands we expect Bash to have, but that it might not due to compilation quirks
5+
# see https://github.com/tianon/docker-bash/pull/45
6+
# and https://www.gnu.org/software/bash/manual/html_node/Optional-Features.html#:~:text=unless%20the%20operating%20system%20does%20not%20provide%20the%20necessary%20support
7+
8+
image="$1"
9+
10+
args=( --rm --interactive )
11+
if [ -t 0 ] && [ -t 1 ]; then
12+
args+=( --tty )
13+
fi
14+
15+
docker run "${args[@]}" "$image" -Eeuo pipefail -xc '
16+
# --enable-array-variables 😏
17+
cmds=(
18+
# --enable-alias
19+
alias unalias
20+
# --enable-command-timing
21+
time
22+
# --enable-cond-command
23+
"[["
24+
# --enable-coprocesses
25+
coproc
26+
# --enable-directory-stack
27+
pushd popd dirs
28+
# --enable-disabled-builtins
29+
builtin enable
30+
# --enable-help-builtin
31+
help
32+
# --enable-history
33+
fc history
34+
# --enable-job-control
35+
bg fg jobs kill wait disown suspend
36+
# --enable-progcomp
37+
complete
38+
# --enable-select
39+
select
40+
)
41+
for cmd in "${cmds[@]}"; do
42+
PATH= command -v "$cmd"
43+
done
44+
'

0 commit comments

Comments
 (0)