diff options
Diffstat (limited to '')
-rwxr-xr-x | tests/cli-opts.sh | 6 | ||||
-rwxr-xr-x | tests/remotes.sh | 6 | ||||
-rwxr-xr-x | tests/tests-lib.sh | 7 |
3 files changed, 13 insertions, 6 deletions
diff --git a/tests/cli-opts.sh b/tests/cli-opts.sh index 9409aab..44dc6ce 100755 --- a/tests/cli-opts.sh +++ b/tests/cli-opts.sh @@ -98,7 +98,8 @@ test_help_flags() { N="$LINENO" OUT="$(mkstemp)" ERR="$(mkstemp)" - LANG=en_US.UTF-8 sh src/git-permalink --something something -h 1>"$OUT" 2>"$ERR" + LANG=en_US.UTF-8 sh src/git-permalink --something something -h \ + 1>"$OUT" 2>"$ERR" STATUS=$? assert_status 2 assert_usage "$ERR" @@ -106,7 +107,8 @@ test_help_flags() { N="$LINENO" OUT="$(mkstemp)" ERR="$(mkstemp)" - LANG=en_US.UTF-8 sh src/git-permalink --help more things 1>"$OUT" 2>"$ERR" + LANG=en_US.UTF-8 sh src/git-permalink --help more things \ + 1>"$OUT" 2>"$ERR" STATUS=$? assert_status 0 assert_empty_stderr diff --git a/tests/remotes.sh b/tests/remotes.sh index 7b1ba92..76aea04 100755 --- a/tests/remotes.sh +++ b/tests/remotes.sh @@ -165,7 +165,8 @@ test_unsupported_remote() { N="$LINENO" OUT="$(mkstemp)" ERR="$(mkstemp)" - git config git-permalink.template-commit-file 'before %s middle %s after' + git config git-permalink.template-commit-file \ + 'before %s middle %s after' git permalink -p README.md 123 1>"$OUT" 2>"$ERR" STATUS=$? assert_status 0 @@ -176,7 +177,8 @@ test_unsupported_remote() { OUT="$(mkstemp)" ERR="$(mkstemp)" git config --unset git-permalink.template-commit-file - git config git-permalink.template-file-commit 'before %s middle %s after' + git config git-permalink.template-file-commit \ + 'before %s middle %s after' git permalink -p README.md 123 1>"$OUT" 2>"$ERR" STATUS=$? assert_status 0 diff --git a/tests/tests-lib.sh b/tests/tests-lib.sh index 03edc2d..25079b9 100755 --- a/tests/tests-lib.sh +++ b/tests/tests-lib.sh @@ -16,7 +16,8 @@ ERROR() { } print_debug_info() { - printf 'LINENO: %s\nOUT: %s\nERR: %s\n' "$N" "$OUT" "$ERR" >&2 + printf 'LINENO: %s\nOUT: %s\nERR: %s\n' \ + "$N" "$OUT" "$ERR" >&2 } assert_status() { @@ -39,7 +40,9 @@ assert_usage() { assert_empty_stream() { if [ -s "$2" ]; then - printf '\n%s: Expected %s (%s) to be empty, but has content:\n%s\n' \ + FMT='\n%s: Expected %s (%s) to be empty, but has content:\n%s\n' + # shellcheck disable=2059 + printf "$FMT" \ "$(ERROR)" "$1" "$2" "$(cat "$2")" >&2 print_debug_info exit 1 |