* testing/lisp/test-ob-clojure.el: Remove incorrect tests (all the tests)

("cider"): Remove assertions for cider.  Clojure supports more than cider.
(ob-clojure/simple-session):
(ob-clojure/initiate-session):
(ob-clojure/initiate-session-with-var): Remove session tests -
ob-clojure has no session support.
(ob-clojure/tangle-without-ns): Remove tangle test - it has no
relation to ob-clojure.

Add FIXME to implement some tests, as we end up with 0 ob-clojure
tests after this commit.

Link: https://orgmode.org/list/87v8d4ivqh.fsf@localhost
This commit is contained in:
Ihor Radchenko 2023-08-25 10:46:36 +03:00
parent 7bdec435ff
commit fcca762741
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 2 additions and 59 deletions

View File

@ -23,68 +23,11 @@
;; Org tests for ob-clojure.el live here
;;; Code:
(org-test-for-executable "cider")
(unless (featurep 'cider)
(signal 'missing-test-dependency "CIDER"))
(unless (featurep 'ob-clojure)
(signal 'missing-test-dependency "Support for Clojure code blocks"))
(ert-deftest ob-clojure/simple-session ()
(org-test-with-temp-text
"#+begin_src clojure :session
(print \"hello, world\")
#+end_src
"
(should (string= "hello, world" (org-babel-execute-src-block)))))
(ert-deftest ob-clojure/initiate-session ()
(org-test-with-temp-text
"#+begin_src clojure :session :var a=1 :results output
(print \"hello, world\")
#+end_src
#+begin_src clojure :session :results output
(print a)
#+end_src"
(goto-char (point-min))
(org-babel-switch-to-session)
(sleep-for 2)
(org-babel-execute-maybe)
(org-babel-next-src-block)
(goto-char (org-babel-result-end))
(forward-line 2)
(should (string=
": 1"
(buffer-substring-no-properties (point-at-bol) (point-at-eol))))))
(ert-deftest ob-clojure/initiate-session-with-var ()
(org-test-with-temp-text
"#+begin_src clojure :session :var a=1 :results output
(print a)
#+end_src"
(org-babel-next-src-block)
(org-babel-initiate-session)
(sleep-for 2)
(org-babel-execute-maybe)
(goto-char (org-babel-result-end))
(forward-line 2)
(should (string=
": 1"
(buffer-substring-no-properties (point-at-bol) (point-at-eol))))))
(ert-deftest ob-clojure/tangle-without-ns ()
(org-test-with-temp-text
"#+begin_src clojure :tangle /tmp/test.clj
(print 1)
#+end_src"
(org-babel-next-src-block)
(org-babel-tangle)
(should
(string=
"(print 1)
"
(with-temp-buffer
(insert-file-contents "/tmp/test.clj")
(buffer-substring-no-properties (point-min) (point-max)))))))
;; FIXME: The old tests where totally off. We need to write new tests.
(provide 'test-ob-clojure)