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

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

[elpa] externals/org aa3eac143d: ob-C: do not swallow double quotes on r


From: ELPA Syncer
Subject: [elpa] externals/org aa3eac143d: ob-C: do not swallow double quotes on raw output
Date: Tue, 27 Sep 2022 12:57:51 -0400 (EDT)

branch: externals/org
commit aa3eac143d41370e076f3df97a39788a769e2563
Author: Thierry Banel <tbanelwebmin@free.fr>
Commit: Thierry Banel <tbanelwebmin@free.fr>

    ob-C: do not swallow double quotes on raw output
    
    * lisp/ob-C.el (org-babel-C-execute): Remove the erroneous
      call to `org-babel-read' when output is raw.
    * testing/examples/ob-C-test.org (Output),
      testing/lisp/test-ob-C.el (ob-C/ouput-doublequotes):
      Add a test with double quotes output.
    
    
https://list.orgmode.org/orgmode/bc004962-679e-498f-b245-ae253aae6271@www.fastmail.com/
---
 lisp/ob-C.el                   |  2 +-
 testing/examples/ob-C-test.org | 12 ++++++++++++
 testing/lisp/test-ob-C.el      |  9 +++++++++
 3 files changed, 22 insertions(+), 1 deletion(-)

diff --git a/lisp/ob-C.el b/lisp/ob-C.el
index e9951cb793..74309a0e97 100644
--- a/lisp/ob-C.el
+++ b/lisp/ob-C.el
@@ -185,7 +185,7 @@ or `org-babel-execute:C++' or `org-babel-execute:D'."
        (setq results (org-remove-indentation results))
        (org-babel-reassemble-table
         (org-babel-result-cond (cdr (assq :result-params params))
-          (org-babel-read results t)
+          results
           (let ((tmp-file (org-babel-temp-file "c-")))
             (with-temp-file tmp-file (insert results))
             (org-babel-import-elisp-from-file tmp-file)))
diff --git a/testing/examples/ob-C-test.org b/testing/examples/ob-C-test.org
index 3b0a41b69e..c7a96f6652 100644
--- a/testing/examples/ob-C-test.org
+++ b/testing/examples/ob-C-test.org
@@ -162,3 +162,15 @@ void main()
   writefln ("Friday %s", tinomogen_h(4,"day"));
 }
 #+end_src
+
+* Output
+:PROPERTIES:
+:ID:       9386490b-4063-4400-842c-4a634edbedf5
+:END:
+
+#+source: double_quotes
+#+begin_src cpp :includes <iostream> :results output verbatim raw
+std::cout << "\"line 1\"\n";
+std::cout << "\"line 2\"\n";
+std::cout << "\"line 3\"\n";
+#+end_src
diff --git a/testing/lisp/test-ob-C.el b/testing/lisp/test-ob-C.el
index 793ca31684..b6dbed8e31 100644
--- a/testing/lisp/test-ob-C.el
+++ b/testing/lisp/test-ob-C.el
@@ -183,5 +183,14 @@
                                 ("Friday" "friday"))
                               (org-babel-execute-src-block))))))
 
+(ert-deftest ob-C/ouput-doublequotes ()
+  "Double quotes not swallowed in raw output"
+  (if (executable-find org-babel-C++-compiler)
+      (org-test-at-id "9386490b-4063-4400-842c-4a634edbedf5"
+                      (org-babel-next-src-block 1)
+                      (should (equal
+                               "\"line 1\"\n\"line 2\"\n\"line 3\"\n"
+                               (org-babel-execute-src-block))))))
+
 (provide 'test-ob-C)
 ;;; test-ob-C.el ends here



reply via email to

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