From c6a81743f95638bc8275bea1b590f4ca9f7cbc39 Mon Sep 17 00:00:00 2001 From: Craig Jennings Date: Sun, 24 May 2026 15:31:07 -0500 Subject: test: cover markdown-html filter and media-player selector MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two real-logic gaps from the refreshed coverage backlog. cj/markdown-html (markdown-config) is the impatient-mode filter that wraps a source buffer's text in the strapdown HTML shell — tested for normal content and an empty buffer. cj/select-media-player (media-utils) was the one untested function there — tested that choosing an available player updates cj/default-media-player and that a non-matching selection leaves it unchanged. Both mock at the boundary (completing-read, the source buffer). --- tests/test-markdown-config.el | 27 +++++++++++++++++++++++++++ tests/test-media-utils.el | 26 ++++++++++++++++++++++++++ 2 files changed, 53 insertions(+) (limited to 'tests') diff --git a/tests/test-markdown-config.el b/tests/test-markdown-config.el index 62d199a8..45e1a601 100644 --- a/tests/test-markdown-config.el +++ b/tests/test-markdown-config.el @@ -23,5 +23,32 @@ `C-c '' opens those blocks in `markdown-mode'." (should (equal (cdr (assoc "markdown" org-src-lang-modes)) 'markdown))) +;;; cj/markdown-html (impatient-mode filter: source buffer -> HTML) + +(ert-deftest test-markdown-html-wraps-source-buffer-content () + "Normal: the source buffer's text is embedded in the strapdown HTML shell." + (let ((src (generate-new-buffer " *md-src*"))) + (unwind-protect + (progn + (with-current-buffer src (insert "# Title\n\nsome **markdown**")) + (with-temp-buffer + (cj/markdown-html src) + (let ((html (buffer-string))) + (should (string-match-p "" html)) + (should (string-match-p "" (buffer-string))) + (should (string-match-p "