aboutsummaryrefslogtreecommitdiff
path: root/tests/cli-opts.sh
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2021-01-24 14:56:02 -0300
committerEuAndreh <eu@euandre.org>2021-01-24 14:56:02 -0300
commitb9061b44194c6564364ee41dfda17df171547cf4 (patch)
tree7f1c15858005b4f827f879e52b3d3ad5f9cc7fa6 /tests/cli-opts.sh
parentremembering: Append to in-memory string instead of intermediate file (diff)
downloadremembering-b9061b44194c6564364ee41dfda17df171547cf4.tar.gz
remembering-b9061b44194c6564364ee41dfda17df171547cf4.tar.xz
tests: Add logs of which test is running
Diffstat (limited to '')
-rwxr-xr-xtests/cli-opts.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/cli-opts.sh b/tests/cli-opts.sh
index efc100b..0562517 100755
--- a/tests/cli-opts.sh
+++ b/tests/cli-opts.sh
@@ -12,24 +12,29 @@ assert_usage() {
}
test_unsupported_long_flags() {
+ testing 'unsupported long flags'
OUT="$(mktemp)"
ERR="$(mktemp)"
sh remembering --unknown-long-flag 1>"$OUT" 2>"$ERR"
STATUS=$?
assert_status 2
assert_usage "$ERR"
+ test_ok
}
test_missing_required_flags() {
+ testing 'missing required flags'
OUT="$(mktemp)"
ERR="$(mktemp)"
sh remembering -a something -b else 1>"$OUT" 2>"$ERR"
STATUS=$?
assert_status 2
assert_usage "$ERR"
+ test_ok
}
test_single_required_flag() {
+ testing 'single required flag'
OUT="$(mktemp)"
ERR="$(mktemp)"
sh remembering -p valid-test-profile 1>"$OUT" 2>"$ERR"
@@ -43,9 +48,11 @@ test_single_required_flag() {
STATUS=$?
assert_status 2
assert_usage "$ERR"
+ test_ok
}
test_flags_without_required_argument() {
+ testing 'flags without required argument'
OUT="$(mktemp)"
ERR="$(mktemp)"
sh remembering -pc 1>"$OUT" 2>"$ERR"
@@ -66,9 +73,11 @@ test_flags_without_required_argument() {
STATUS=$?
assert_status 2
assert_usage "$ERR"
+ test_ok
}
test_valid_options() {
+ testing 'valid options'
OUT="$(mktemp)"
ERR="$(mktemp)"
printf 'a\nb\nc\n' | \
@@ -80,9 +89,11 @@ test_valid_options() {
assert_status 0
assert_empty_stderr
assert_stdout 'a'
+ test_ok
}
test_help_flags() {
+ testing 'help flags'
OUT="$(mktemp)"
ERR="$(mktemp)"
sh remembering -h 1>"$OUT" 2>"$ERR"
@@ -98,6 +109,7 @@ test_help_flags() {
assert_status 0
assert_empty_stderr
assert_usage "$OUT"
+ test_ok
}
test_unsupported_long_flags