From 982e484f001e7619ba117f43e3f626d305952b12 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Tue, 5 May 2026 14:53:15 -0500 Subject: test: cover the active-input-method branch of response-get-buffer-create MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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%). --- tests/test-org-drill-response-and-timer.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests') 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 -- cgit v1.2.3