123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- (unless (featurep 'ob-scheme)
- (signal 'missing-test-dependency "Support for Scheme code blocks"))
- (ert-deftest test-ob-scheme/tables ()
- "Test table output."
- (equal "#+begin_src scheme
- '(1 2 3)
- #+end_src
- #+RESULTS:
- | 1 | 2 | 3 |
- "
- (org-test-with-temp-text "#+begin_src scheme\n'(1 2 3)\n#+end_src"
- (org-babel-execute-maybe)
- (buffer-string))))
- (ert-deftest test-ob-scheme/verbatim ()
- "Test verbatim output."
- (should
- (equal ": (1 2 3)\n"
- (org-test-with-temp-text "#+begin_src scheme :results verbatim\n'(1 2 3)\n#+end_src"
- (org-babel-execute-src-block)
- (let ((case-fold-search t)) (search-forward "#+results"))
- (buffer-substring-no-properties (line-beginning-position 2)
- (point-max))))))
- (ert-deftest test-ob-scheme/list ()
- "Test list output."
- (should
- (equal "- 1\n- 2\n- 3\n"
- (org-test-with-temp-text "#+begin_src scheme :results list\n'(1 2 3)\n#+end_src"
- (org-babel-execute-maybe)
- (let ((case-fold-search t)) (search-forward "#+results"))
- (buffer-substring-no-properties (line-beginning-position 2)
- (point-max))))))
- (ert-deftest test-ob-scheme/prologue ()
- "Test :prologue parameter."
- (should
- (equal "#+begin_src scheme :prologue \"(define x 2)\"
- x
- #+end_src
- #+RESULTS:
- : 2
- "
- (org-test-with-temp-text
- "#+begin_src scheme :prologue \"(define x 2)\"\nx\n#+end_src"
- (org-babel-execute-maybe)
- (buffer-string))))
- (should
- (equal
- "#+begin_src scheme :prologue \"(define x 2)\" :var y=1
- x
- #+end_src
- #+RESULTS:
- : 2
- "
- (org-test-with-temp-text
- "#+begin_src scheme :prologue \"(define x 2)\" :var y=1\nx\n#+end_src"
- (org-babel-execute-maybe)
- (buffer-string)))))
- (ert-deftest test-ob-scheme/unspecified ()
- "Test <#unspecified> return value."
- (should
- (equal "#+begin_src scheme
- \(define (mysquare x)
- (* x x))
- #+end_src
- #+RESULTS:
- : #<unspecified>
- "
- (org-test-with-temp-text
- "#+begin_src scheme
- (define (mysquare x)
- (* x x))
- #+end_src"
- (org-babel-execute-maybe)
- (buffer-string)))))
- (provide 'test-ob-scheme)
|