From 5405d0419295bb1a0314cb2b3ce07713fc77e792 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rudolf=20Adamkovi=C4=8D?= Date: Fri, 21 Oct 2022 14:48:56 +0200 Subject: [PATCH] test-ob-java: Test Java source block header arguments at all levels MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * testing/lisp/test-ob-java.el (ob-java/lint-header-arguments): Renamed to ob-java/lint-header-args-block. * testing/lisp/test-ob-java.el (ob-java/lint-header-args-heading): Test source block header arguments at the heading level. * testing/lisp/test-ob-java.el (ob-java/lint-header-args-buffer): Test source block header arguments at the buffer level. Reported-by: Rudolf Adamkovič Link: https://orgmode.org/list/m2y1ta9rqe.fsf@me.com --- testing/lisp/test-ob-java.el | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/testing/lisp/test-ob-java.el b/testing/lisp/test-ob-java.el index a62d66557..1cc7fbeb2 100644 --- a/testing/lisp/test-ob-java.el +++ b/testing/lisp/test-ob-java.el @@ -27,7 +27,36 @@ ;;; No Java required -(ert-deftest ob-java/lint-header-arguments () +(ert-deftest ob-java/lint-header-args-buffer () + ;; Test that the Org linter accepts every supported Java source + ;; block header argument at the buffer level. + (org-test-with-temp-text " +#+property: header-args:java+ :dir /tmp +#+property: header-args:java+ :classname com.example.Example +#+property: header-args:java+ :imports com.example.OtherExample +#+property: header-args:java+ :cmpflag -classpath .:/tmp/example/ +#+property: header-args:java+ :cmdline -classpath .:/tmp/example/ +#+property: header-args:java+ :cmdarg -verbose" + (should-not (org-lint '(wrong-header-argument))))) + +(ert-deftest ob-java/lint-header-args-heading () + ;; Test that the Org linter accepts every supported Java source + ;; block header argument at the heading level. + (org-test-with-temp-text " +* Test +:PROPERTIES: +:header-args:java+: :dir /tmp +:header-args:java+: :classname com.example.Example +:header-args:java+: :imports com.example.OtherExample +:header-args:java+: :cmpflag -classpath .:/tmp/example/ +:header-args:java+: :cmdline -classpath .:/tmp/example/ +:header-args:java+: :cmdarg -verbose +:END:" + (should-not (org-lint '(wrong-header-argument))))) + +(ert-deftest ob-java/lint-header-args-block () + ;; Test that the Org linter accepts every supported Java source + ;; block header argument at the block level. (org-test-with-temp-text " #+header: :dir /tmp #+header: :classname com.example.Example -- 2.38.0