diff options
| author | Craig Jennings <c@cjennings.net> | 2026-05-05 14:53:15 -0500 |
|---|---|---|
| committer | Craig Jennings <c@cjennings.net> | 2026-05-05 14:53:15 -0500 |
| commit | 982e484f001e7619ba117f43e3f626d305952b12 (patch) | |
| tree | df027b71574d7ff43ccc315fd72135d85f48c77e | |
| parent | 318044608dedd94dd69550c0365036935480554c (diff) | |
| download | org-drill-982e484f001e7619ba117f43e3f626d305952b12.tar.gz org-drill-982e484f001e7619ba117f43e3f626d305952b12.zip | |
test: cover the active-input-method branch of response-get-buffer-create
I added a small case for `org-drill-response-get-buffer-create' that
sets an input method then asserts the helper propagates it into the
new response buffer.
Coverage stayed near 94.7% (instrumentation noise can move it ±0.2%).
| -rw-r--r-- | tests/test-org-drill-response-and-timer.el | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/test-org-drill-response-and-timer.el b/tests/test-org-drill-response-and-timer.el index 4da8e9a..e3c198a 100644 --- a/tests/test-org-drill-response-and-timer.el +++ b/tests/test-org-drill-response-and-timer.el @@ -104,5 +104,17 @@ exit-recursive-edit and kill-buffer are stubbed." (should (= (point-min) (point-max)))) (kill-buffer buf)))) +(ert-deftest test-response-get-buffer-create-with-active-input-method-propagates () + "If an input method is active, it's activated in the new buffer." + (let ((activated-with nil)) + (cl-letf (((symbol-function 'activate-input-method) + (lambda (im) (setq activated-with im))) + ((symbol-function 'set-input-method) #'ignore)) + (let ((current-input-method 'pretend-im)) + (let ((buf (org-drill-response-get-buffer-create))) + (unwind-protect + (should (eq 'pretend-im activated-with)) + (kill-buffer buf))))))) + (provide 'test-org-drill-response-and-timer) ;;; test-org-drill-response-and-timer.el ends here |
