aboutsummaryrefslogtreecommitdiff
path: root/tests/cli-opts.sh
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2021-06-12 19:01:31 -0300
committerEuAndreh <eu@euandre.org>2021-06-12 19:01:31 -0300
commit69c4a5e27cfb4a347987e2dc5c9c20b29cce7d0a (patch)
tree6a5030f6f6030457c5fa70e237097642c8449424 /tests/cli-opts.sh
parenttests/xdg-open: Remove unused file (diff)
downloadgit-permalink-69c4a5e27cfb4a347987e2dc5c9c20b29cce7d0a.tar.gz
git-permalink-69c4a5e27cfb4a347987e2dc5c9c20b29cce7d0a.tar.xz
src/git-permalink.sh: Fix bad treatment of -p flag
Diffstat (limited to 'tests/cli-opts.sh')
-rwxr-xr-xtests/cli-opts.sh14
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/cli-opts.sh b/tests/cli-opts.sh
index 6bd6adf..befff4d 100755
--- a/tests/cli-opts.sh
+++ b/tests/cli-opts.sh
@@ -89,15 +89,25 @@ test_version_flags() {
test_unsupported_flags_are_treated_as_arguments() {
testing 'usupported flags are treated as arguments'
+
OUT="$(mktemp)"
ERR="$(mktemp)"
./git-permalink --first-flag --second-flag 1>"$OUT" 2>"$ERR"
STATUS=$?
assert_status 0
- assert_fgrep_stdout "--first-flag"
+ assert_empty_stdout
assert_fgrep_stderr "--first-flag"
- assert_fgrep_stdout "--second-flag"
assert_fgrep_stderr "--second-flag"
+
+ OUT="$(mktemp)"
+ ERR="$(mktemp)"
+ ./git-permalink -p --first-flag --second-flag 1>"$OUT" 2>"$ERR"
+ STATUS=$?
+ assert_status 0
+ assert_empty_stderr
+ assert_fgrep_stdout "--first-flag"
+ assert_fgrep_stdout "--second-flag"
+
test_ok
}