emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/org ee3dbb0fdb 1/2: ob-java: Define the list of all sup


From: ELPA Syncer
Subject: [elpa] externals/org ee3dbb0fdb 1/2: ob-java: Define the list of all supported header arguments
Date: Fri, 21 Oct 2022 00:58:09 -0400 (EDT)

branch: externals/org
commit ee3dbb0fdb6e119207f13a165e90b878b741cf49
Author: Rudolf Adamkovič <salutis@me.com>
Commit: Ihor Radchenko <yantar92@posteo.net>

    ob-java: Define the list of all supported header arguments
    
    * lisp/ob-java.el (org-babel-header-args:java): Complete the list of
    header arguments supported for Java source blocks.
    * testing/lisp/test-ob-java.el (ob-java/lint-header-arguments): Test
    that the linter approves of all the supported arguments.
---
 lisp/ob-java.el              |  8 +++++++-
 testing/lisp/test-ob-java.el | 17 +++++++++++++++++
 2 files changed, 24 insertions(+), 1 deletion(-)

diff --git a/lisp/ob-java.el b/lisp/ob-java.el
index 832214f5c4..395dbd20dc 100644
--- a/lisp/ob-java.el
+++ b/lisp/ob-java.el
@@ -53,7 +53,13 @@ directory, so we keep that as the default behavior.
 
 [1] https://orgmode.org/manual/Results-of-Evaluation.html";)
 
-(defconst org-babel-header-args:java '((imports . :any))
+(defconst org-babel-header-args:java
+  '((dir       . :any)
+    (classname . :any)
+    (imports   . :any)
+    (cmpflag   . :any)
+    (cmdline   . :any)
+    (cmdarg    . :any))
   "Java-specific header arguments.")
 
 (defcustom org-babel-java-command "java"
diff --git a/testing/lisp/test-ob-java.el b/testing/lisp/test-ob-java.el
index 215f1cb515..a62d66557b 100644
--- a/testing/lisp/test-ob-java.el
+++ b/testing/lisp/test-ob-java.el
@@ -21,9 +21,26 @@
 ;; along with this program.  If not, see <https://www.gnu.org/licenses/>.
 
 ;;; Code:
+
 (require 'org-test "../testing/org-test")
 (require 'ob-core)
 
+;;; No Java required
+
+(ert-deftest ob-java/lint-header-arguments ()
+  (org-test-with-temp-text "
+#+header: :dir /tmp
+#+header: :classname com.example.Example
+#+header: :imports com.example.OtherExample
+#+header: :cmpflag -classpath .:/tmp/example/
+#+header: :cmdline -classpath .:/tmp/example/
+#+header: :cmdarg -verbose
+#+begin_src java
+#+end_src"
+    (should-not (org-lint '(wrong-header-argument)))))
+
+;;; Java required
+
 (org-test-for-executable "java")
 (org-test-for-executable "javac")
 (unless (featurep 'ob-java)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]