aboutsummaryrefslogtreecommitdiff
path: root/tests/cli-opts.sh
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xtests/cli-opts.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/cli-opts.sh b/tests/cli-opts.sh
index 0562517..6957e4e 100755
--- a/tests/cli-opts.sh
+++ b/tests/cli-opts.sh
@@ -112,6 +112,22 @@ test_help_flags() {
test_ok
}
+test_version_flags() {
+ testing 'version flags'
+ OUT="$(mktemp)"
+ ERR="$(mktemp)"
+ sh remembering -V 1>"$OUT" 2>"$ERR"
+ STATUS=$?
+ assert_status 0
+ assert_empty_stderr
+ if ! grep -Eq '^remembering-.+$' "$OUT"; then
+ printf '\nERR: Bad STDOUT (%s)\n\nexpected: %s\ngot: %s\n' \
+ "$OUT" '^remembering-.+$' "$(cat "$OUT")" >&2
+ exit 1
+ fi
+ test_ok
+}
+
test_unsupported_long_flags
test_missing_required_flags
test_missing_required_flags
@@ -119,3 +135,4 @@ test_single_required_flag
test_flags_without_required_argument
test_valid_options
test_help_flags
+test_version_flags