From 01d37764238bca11f22601e8ee69d0b3d38d93c5 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Tue, 26 Jan 2021 23:00:24 -0300 Subject: remembering: Add -V version flag, add missing docs on -h flag --- tests/cli-opts.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'tests') 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 -- cgit v1.2.3