aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCraig Jennings <c@cjennings.net>2026-05-05 14:45:01 -0500
committerCraig Jennings <c@cjennings.net>2026-05-05 14:45:01 -0500
commit962cf79cfbfaa943a09e530b4a73b1fcafe1f220 (patch)
treefdfccd1a41b974c2d6674ade6f8bbba2ed93d6b5 /tests
parentff15b65e990fa40508666b00aa77ed9e5b73a881 (diff)
downloadorg-drill-962cf79cfbfaa943a09e530b4a73b1fcafe1f220.tar.gz
org-drill-962cf79cfbfaa943a09e530b4a73b1fcafe1f220.zip
test: cover all navigation arrow keys in --read-rating-key
I extended the existing rating-key test with a dolist that fires every remaining navigation key (up, left, right, prior, next) — previously only `down' was covered. Each key advances the loop without ending it, then a numeric input terminates. Coverage moved from 92.3% to 92.7%.
Diffstat (limited to 'tests')
-rw-r--r--tests/test-org-drill-read-rating-key.el9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test-org-drill-read-rating-key.el b/tests/test-org-drill-read-rating-key.el
index 7f05755..2a54a2c 100644
--- a/tests/test-org-drill-read-rating-key.el
+++ b/tests/test-org-drill-read-rating-key.el
@@ -56,6 +56,15 @@ numeric input ends the loop."
(with-keys-and-buffer (list (vector 'down) "5")
(should (eql ?5 (org-drill--read-rating-key nil "help")))))
+(ert-deftest test-read-rating-key-handles-all-navigation-keys ()
+ "All six navigation keys (up/down/left/right/prior/next) are accepted
+without terminating the loop, then a numeric ends it."
+ (cl-letf (((symbol-function 'scroll-down) #'ignore)
+ ((symbol-function 'scroll-up) #'ignore))
+ (dolist (key '(up left right prior next))
+ (with-keys-and-buffer (list (vector key) "1")
+ (should (eql ?1 (org-drill--read-rating-key nil "help")))))))
+
(ert-deftest test-read-rating-key-wheel-event-then-numeric ()
"A wheel-event vector is dispatched without terminating; loop ends on
the next numeric character."