From 3a30cb48e855a7bd5bad80a7ca46aec4f7838fe8 Mon Sep 17 00:00:00 2001 From: Damien Cassou Date: Tue, 19 Mar 2024 21:32:24 +0100 Subject: [PATCH] Add support for inline src-block --- test/ox-linuxmag-fr-tests.el | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/ox-linuxmag-fr-tests.el b/test/ox-linuxmag-fr-tests.el index fe57483..9ff1741 100644 --- a/test/ox-linuxmag-fr-tests.el +++ b/test/ox-linuxmag-fr-tests.el @@ -28,6 +28,7 @@ (require 'ert) (require 'ox-linuxmag-fr) +(require 'ob-shell) (defconst ox-linuxmag-fr-tests-default-preamble "#+title: Titre de l'article @@ -48,7 +49,8 @@ Make the buffer containing the result current. OX-LINUXMAG-FR-FIGURE-FILES and OX-LINUXMAG-FR-OTHER-FILES are hashtables. OX-LINUXMAG-FR-BASENAME is a string." - (let* ((xml-content (with-temp-buffer + (let* ((org-confirm-babel-evaluate nil) + (xml-content (with-temp-buffer (unless (string-prefix-p "#+title:" string) (insert ox-linuxmag-fr-tests-default-preamble) (insert "\n")) @@ -59,7 +61,8 @@ hashtables. OX-LINUXMAG-FR-BASENAME is a string." :ox-linuxmag-fr-other-files ox-linuxmag-fr-other-files :ox-linuxmag-fr-basename - ox-linuxmag-fr-basename)))) + ox-linuxmag-fr-basename + :with-latex 'verbatim)))) (buffer (get-buffer-create "*ox-linuxmag-fr-test*"))) (switch-to-buffer buffer) (erase-buffer) @@ -116,6 +119,10 @@ hashtables. OX-LINUXMAG-FR-BASENAME is a string." (ox-linuxmag-fr-tests-export "Test =foo=") (should (ox-linuxmag-fr-tests-contain "Test foo"))) +(ert-deftest ox-linuxmag-fr-tests-inline-src-block () + (ox-linuxmag-fr-tests-export "Test src_sh{echo foo}") + (should (ox-linuxmag-fr-tests-contain "Test foo"))) + (ert-deftest ox-linuxmag-fr-tests-headline-numbered () (ox-linuxmag-fr-tests-export "* Titre 1\n** Titre 1.1") (should (ox-linuxmag-fr-tests-contain "1. Titre 1"))