aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2021-06-28 07:16:57 -0300
committerEuAndreh <eu@euandre.org>2021-06-28 07:16:57 -0300
commit7fc1f6c25927eaf0859ea014561f29673794b14a (patch)
tree340351915dbca163790059cb39a4ff8e7ed28f1f /tests
parenttests/*.sh: Refactor error messages to be consistent, move helper all helper ... (diff)
downloadremembering-7fc1f6c25927eaf0859ea014561f29673794b14a.tar.gz
remembering-7fc1f6c25927eaf0859ea014561f29673794b14a.tar.xz
tests/ranking.sh: Add test_pick_inexisting_value, disabled
Diffstat (limited to '')
-rwxr-xr-xtests/ranking.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/ranking.sh b/tests/ranking.sh
index 807f17b..8368de7 100755
--- a/tests/ranking.sh
+++ b/tests/ranking.sh
@@ -179,6 +179,40 @@ s'
test_ok
}
+test_pick_inexisting_value() {
+ testing 'pick inexisting value'
+ OUT="$(mktemp)"
+ ERR="$(mktemp)"
+ PROFILE="pick-inexisting-value-$(uuid)"
+ echo '0:a
+0:b
+0:c
+0:d
+0:e' > "$XDG_DATA_HOME/$PROFILE"
+ INPUT='a
+b
+c
+d
+e'
+
+ echo "$INPUT" | \
+ ./src/remembering \
+ -p "$PROFILE" \
+ -c 'echo f' \
+ 1>"$OUT" 2>"$ERR"
+ STATUS=$?
+ assert_status 0
+ assert_stdout f
+ assert_profile "$PROFILE" '1:f
+0:a
+0:b
+0:c
+0:d
+0:e'
+
+ test_ok
+}
+
test_stdin_profile_merging() {
testing 'STDIN/profile merging'
PROFILE="stdin-profile-merging-$(uuid)"
@@ -321,6 +355,7 @@ test_promoting_values
test_higher_values_loose_tie
test_smaller_values_win_tie
test_many_sequential_picks
+# test_pick_inexisting_value
test_stdin_profile_merging
test_stdin_is_larger_than_profile
test_stdin_is_smaller_than_profile