testing: Make all files use `lexical-binding`
Mainly, add the corresponding cookie, but also add various `require`s
so that the compiler knows which vars should be trated as dynbound.
This does not fix all the warnings, but does try to eliminate
all those about "unused" variables. For the variables truly unused,
the patch usually adds an underscore to their name to silence the warning.
Some of the fixes affect files which already used `lexical-binding`.
Not sure why the test worked before: maybe because the tests were run
without compiling them first (which could cause some of the
missing `require`d packages to be autoloaded before we got to the
problematic code, thus hiding the problem)?
I found some suspicious code, for which I added FIXMEs.
There are also a few changes to the main files.
* lisp/org-protocol.el (org-protocol-check-filename-for-protocol):
Don't call `server-edit` if it's not yet defined. [ Needed to get
the tests to pass. ]
* lisp/ob-core.el (org-babel-temporary-directory)
(org-babel-temporary-stable-directory): Always define (and use nil
if we don't want to create a directory for it). Simplify the code based
on the fact that (defvar V E) only evaluates E if V is not yet `boundp`.
(org-babel-temp-file, org-babel-temp-stable-file)
(org-babel-remove-temporary-directory)
(org-babel-remove-temporary-stable-directory): Adjust accordingly.
* lisp/org.el (org-log-beginning): Add FIXME.
* testing/org-test.el: Require `org` and `org-id`.
(org-id-locations-file): Don't `defconst` it.
(org-test-at-id, org-test-in-example-file, org-test-at-marker)
(org-test-with-temp-text, org-test-with-temp-text-in-file): Move edebug
specs into `declare` (and simplify them).
(org-test-with-tramp-remote-dir--worker): Declare dynbound tramp vars.
(org--compile-when): Fix quoting of `exp`.
(org-test-load): Tweak regexps.
* testing/org-batch-test-init.el: Tweak regexp, remove dead code and
add a FIXME about it.
* testing/lisp/test-ox.el: Require `ox` instead of
erroring out if it's not already loaded. Also require `org-inlinetask`.
(org-test-with-parsed-data): Silence warnings when `info` is not used.
(test-org-export/bind-keyword): Add FIXME.
* testing/lisp/test-ox-publish.el: Require `org-test` and `ox-publish`.
(test-org-publish/resolve-external-link): Expose lambdas to
the compiler. Remove unused var `ids`.
(test-org-publish/get-project-from-filename): Remove unused var `file`.
* testing/lisp/test-org.el: Require `org-macs`, `org`,
`org-inlinetask`, `org-refile`, and `org-agenda`.
(test-org/org-read-date): Declare `org-time-was-given` as dynbound.
(test-org/set-regexps-and-options): Add FIXME.
* testing/lisp/test-org-timer.el: Require `org-timer`.
* testing/lisp/test-org-table.el: Require `ox`.
* testing/lisp/test-org-protocol.el: Require `org-protocol` instead of
erroring out if it's not already loaded. Also require `capture`, and
add missing `provide` statement.
* testing/lisp/test-org-pcomplete.el: Require `org`.
* testing/lisp/test-org-list.el: Require `org-list` and `org`.
* testing/lisp/test-org-lint.el: Require `org-footnote` and `org-lint`.
* testing/lisp/test-org-footnote.el: Require `org-footnote`.
* testing/lisp/test-org-element.el: Require `org-element` instead of
erroring out if it's not already loaded. Also require `org` and
`org-inlinetask`.
* testing/lisp/test-org-duration.el: Require `org-duration`.
* testing/lisp/test-org-datetree.el: Require `org-datetree`.
* testing/lisp/test-org-colview.el: Require `org-colview`,
`org-duration`, and `org-inlinetask`.
* testing/lisp/test-org-clock.el: Require `org-duration` and `org-clock`.
* testing/lisp/test-org-archive.el: Require `org-archive`.
* testing/lisp/test-org-agenda.el
(test-org-agenda/bulk-custom-arg-func): Add FIXME.
* testing/lisp/test-ol.el: Require `ol` and `org-id`.
(test-org-link/store-link): Declare `org-store-link-props` and add FIXME.
* testing/lisp/test-oc.el (test-org-cite/export-capability): Add FIXME.
* testing/lisp/test-ob.el: Require `ob-core`, `org-src`, `ob-ref`,
and `org-table`.
(test-ob/eval-header-argument): Rename `foo` to `test-ob--foo` and
declare it as dynbound.
(test-ob/blocks-with-spaces, test-ob/specific-colnames): Add FIXME.
(test-ob/noweb-expansions-in-cache):
Declare `noweb-expansions-in-cache-var` as dynbound.
* testing/lisp/test-ob-tangle.el: Require `org` and `ob-tangle`.
* testing/lisp/test-ob-shell.el:
* testing/lisp/test-ob-python.el: Require `ob-core`.
* testing/lisp/test-ob-lob.el: Require `ob-lob`.
(temporary-value-for-test): Declare as dynbound.
* testing/lisp/test-ob-plantuml.el: Require `ob-plantuml` instead of
erroring out if it's not already loaded.
* testing/lisp/test-ob-lilypond.el: Require `ob-lilypond` instead of
erroring out if it's not already loaded. Use `with-current-buffer`.
* testing/lisp/test-ob-julia.el: Require `ob-core`.
* testing/lisp/test-ob-java.el (org-babel-temporary-directory):
Remove dead code now that `org-babel-temporary-directory` is always bound.
* testing/lisp/test-ob-exp.el: Require `ob-exp`, `org-src`, and `org-test`.
(ob-exp/evaluate-all-executables-in-order):
Declare `*evaluation-collector*` as dynbound.
* testing/lisp/test-ob-emacs-lisp.el (ob-emacs-lisp/dynamic-lexical-edit)
(ob-emacs-lisp/dynamic-lexical-execute):
Rename dynbound var to `ob-emacs--x` and declare it as such.
* testing/lisp/test-ob-R.el: Require `ob-core`.
(ess-ask-for-ess-directory, ess-history-file): Declare vars.
2022-09-14 17:21:37 -04:00
|
|
|
;;; test-ob-lilypond.el --- tests for ob-lilypond.el -*- lexical-binding: t; -*-
|
2011-09-12 12:07:21 -04:00
|
|
|
|
2019-01-01 05:50:56 -05:00
|
|
|
;; Copyright (c) 2010-2014, 2019 Martyn Jago
|
2011-09-12 12:07:21 -04:00
|
|
|
;; Authors: Martyn Jago
|
|
|
|
|
2012-12-13 11:24:19 -05:00
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
|
|
|
|
;; This program is free software; you can redistribute it and/or modify
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
|
|
|
|
|
|
|
;; This program is distributed in the hope that it will be useful,
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
2021-03-20 03:27:57 -04:00
|
|
|
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
2011-09-12 12:07:21 -04:00
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
;;; Code:
|
testing: Make all files use `lexical-binding`
Mainly, add the corresponding cookie, but also add various `require`s
so that the compiler knows which vars should be trated as dynbound.
This does not fix all the warnings, but does try to eliminate
all those about "unused" variables. For the variables truly unused,
the patch usually adds an underscore to their name to silence the warning.
Some of the fixes affect files which already used `lexical-binding`.
Not sure why the test worked before: maybe because the tests were run
without compiling them first (which could cause some of the
missing `require`d packages to be autoloaded before we got to the
problematic code, thus hiding the problem)?
I found some suspicious code, for which I added FIXMEs.
There are also a few changes to the main files.
* lisp/org-protocol.el (org-protocol-check-filename-for-protocol):
Don't call `server-edit` if it's not yet defined. [ Needed to get
the tests to pass. ]
* lisp/ob-core.el (org-babel-temporary-directory)
(org-babel-temporary-stable-directory): Always define (and use nil
if we don't want to create a directory for it). Simplify the code based
on the fact that (defvar V E) only evaluates E if V is not yet `boundp`.
(org-babel-temp-file, org-babel-temp-stable-file)
(org-babel-remove-temporary-directory)
(org-babel-remove-temporary-stable-directory): Adjust accordingly.
* lisp/org.el (org-log-beginning): Add FIXME.
* testing/org-test.el: Require `org` and `org-id`.
(org-id-locations-file): Don't `defconst` it.
(org-test-at-id, org-test-in-example-file, org-test-at-marker)
(org-test-with-temp-text, org-test-with-temp-text-in-file): Move edebug
specs into `declare` (and simplify them).
(org-test-with-tramp-remote-dir--worker): Declare dynbound tramp vars.
(org--compile-when): Fix quoting of `exp`.
(org-test-load): Tweak regexps.
* testing/org-batch-test-init.el: Tweak regexp, remove dead code and
add a FIXME about it.
* testing/lisp/test-ox.el: Require `ox` instead of
erroring out if it's not already loaded. Also require `org-inlinetask`.
(org-test-with-parsed-data): Silence warnings when `info` is not used.
(test-org-export/bind-keyword): Add FIXME.
* testing/lisp/test-ox-publish.el: Require `org-test` and `ox-publish`.
(test-org-publish/resolve-external-link): Expose lambdas to
the compiler. Remove unused var `ids`.
(test-org-publish/get-project-from-filename): Remove unused var `file`.
* testing/lisp/test-org.el: Require `org-macs`, `org`,
`org-inlinetask`, `org-refile`, and `org-agenda`.
(test-org/org-read-date): Declare `org-time-was-given` as dynbound.
(test-org/set-regexps-and-options): Add FIXME.
* testing/lisp/test-org-timer.el: Require `org-timer`.
* testing/lisp/test-org-table.el: Require `ox`.
* testing/lisp/test-org-protocol.el: Require `org-protocol` instead of
erroring out if it's not already loaded. Also require `capture`, and
add missing `provide` statement.
* testing/lisp/test-org-pcomplete.el: Require `org`.
* testing/lisp/test-org-list.el: Require `org-list` and `org`.
* testing/lisp/test-org-lint.el: Require `org-footnote` and `org-lint`.
* testing/lisp/test-org-footnote.el: Require `org-footnote`.
* testing/lisp/test-org-element.el: Require `org-element` instead of
erroring out if it's not already loaded. Also require `org` and
`org-inlinetask`.
* testing/lisp/test-org-duration.el: Require `org-duration`.
* testing/lisp/test-org-datetree.el: Require `org-datetree`.
* testing/lisp/test-org-colview.el: Require `org-colview`,
`org-duration`, and `org-inlinetask`.
* testing/lisp/test-org-clock.el: Require `org-duration` and `org-clock`.
* testing/lisp/test-org-archive.el: Require `org-archive`.
* testing/lisp/test-org-agenda.el
(test-org-agenda/bulk-custom-arg-func): Add FIXME.
* testing/lisp/test-ol.el: Require `ol` and `org-id`.
(test-org-link/store-link): Declare `org-store-link-props` and add FIXME.
* testing/lisp/test-oc.el (test-org-cite/export-capability): Add FIXME.
* testing/lisp/test-ob.el: Require `ob-core`, `org-src`, `ob-ref`,
and `org-table`.
(test-ob/eval-header-argument): Rename `foo` to `test-ob--foo` and
declare it as dynbound.
(test-ob/blocks-with-spaces, test-ob/specific-colnames): Add FIXME.
(test-ob/noweb-expansions-in-cache):
Declare `noweb-expansions-in-cache-var` as dynbound.
* testing/lisp/test-ob-tangle.el: Require `org` and `ob-tangle`.
* testing/lisp/test-ob-shell.el:
* testing/lisp/test-ob-python.el: Require `ob-core`.
* testing/lisp/test-ob-lob.el: Require `ob-lob`.
(temporary-value-for-test): Declare as dynbound.
* testing/lisp/test-ob-plantuml.el: Require `ob-plantuml` instead of
erroring out if it's not already loaded.
* testing/lisp/test-ob-lilypond.el: Require `ob-lilypond` instead of
erroring out if it's not already loaded. Use `with-current-buffer`.
* testing/lisp/test-ob-julia.el: Require `ob-core`.
* testing/lisp/test-ob-java.el (org-babel-temporary-directory):
Remove dead code now that `org-babel-temporary-directory` is always bound.
* testing/lisp/test-ob-exp.el: Require `ob-exp`, `org-src`, and `org-test`.
(ob-exp/evaluate-all-executables-in-order):
Declare `*evaluation-collector*` as dynbound.
* testing/lisp/test-ob-emacs-lisp.el (ob-emacs-lisp/dynamic-lexical-edit)
(ob-emacs-lisp/dynamic-lexical-execute):
Rename dynbound var to `ob-emacs--x` and declare it as such.
* testing/lisp/test-ob-R.el: Require `ob-core`.
(ess-ask-for-ess-directory, ess-history-file): Declare vars.
2022-09-14 17:21:37 -04:00
|
|
|
(require 'ob-lilypond)
|
2011-09-12 12:07:21 -04:00
|
|
|
|
testing: Make all files use `lexical-binding`
Mainly, add the corresponding cookie, but also add various `require`s
so that the compiler knows which vars should be trated as dynbound.
This does not fix all the warnings, but does try to eliminate
all those about "unused" variables. For the variables truly unused,
the patch usually adds an underscore to their name to silence the warning.
Some of the fixes affect files which already used `lexical-binding`.
Not sure why the test worked before: maybe because the tests were run
without compiling them first (which could cause some of the
missing `require`d packages to be autoloaded before we got to the
problematic code, thus hiding the problem)?
I found some suspicious code, for which I added FIXMEs.
There are also a few changes to the main files.
* lisp/org-protocol.el (org-protocol-check-filename-for-protocol):
Don't call `server-edit` if it's not yet defined. [ Needed to get
the tests to pass. ]
* lisp/ob-core.el (org-babel-temporary-directory)
(org-babel-temporary-stable-directory): Always define (and use nil
if we don't want to create a directory for it). Simplify the code based
on the fact that (defvar V E) only evaluates E if V is not yet `boundp`.
(org-babel-temp-file, org-babel-temp-stable-file)
(org-babel-remove-temporary-directory)
(org-babel-remove-temporary-stable-directory): Adjust accordingly.
* lisp/org.el (org-log-beginning): Add FIXME.
* testing/org-test.el: Require `org` and `org-id`.
(org-id-locations-file): Don't `defconst` it.
(org-test-at-id, org-test-in-example-file, org-test-at-marker)
(org-test-with-temp-text, org-test-with-temp-text-in-file): Move edebug
specs into `declare` (and simplify them).
(org-test-with-tramp-remote-dir--worker): Declare dynbound tramp vars.
(org--compile-when): Fix quoting of `exp`.
(org-test-load): Tweak regexps.
* testing/org-batch-test-init.el: Tweak regexp, remove dead code and
add a FIXME about it.
* testing/lisp/test-ox.el: Require `ox` instead of
erroring out if it's not already loaded. Also require `org-inlinetask`.
(org-test-with-parsed-data): Silence warnings when `info` is not used.
(test-org-export/bind-keyword): Add FIXME.
* testing/lisp/test-ox-publish.el: Require `org-test` and `ox-publish`.
(test-org-publish/resolve-external-link): Expose lambdas to
the compiler. Remove unused var `ids`.
(test-org-publish/get-project-from-filename): Remove unused var `file`.
* testing/lisp/test-org.el: Require `org-macs`, `org`,
`org-inlinetask`, `org-refile`, and `org-agenda`.
(test-org/org-read-date): Declare `org-time-was-given` as dynbound.
(test-org/set-regexps-and-options): Add FIXME.
* testing/lisp/test-org-timer.el: Require `org-timer`.
* testing/lisp/test-org-table.el: Require `ox`.
* testing/lisp/test-org-protocol.el: Require `org-protocol` instead of
erroring out if it's not already loaded. Also require `capture`, and
add missing `provide` statement.
* testing/lisp/test-org-pcomplete.el: Require `org`.
* testing/lisp/test-org-list.el: Require `org-list` and `org`.
* testing/lisp/test-org-lint.el: Require `org-footnote` and `org-lint`.
* testing/lisp/test-org-footnote.el: Require `org-footnote`.
* testing/lisp/test-org-element.el: Require `org-element` instead of
erroring out if it's not already loaded. Also require `org` and
`org-inlinetask`.
* testing/lisp/test-org-duration.el: Require `org-duration`.
* testing/lisp/test-org-datetree.el: Require `org-datetree`.
* testing/lisp/test-org-colview.el: Require `org-colview`,
`org-duration`, and `org-inlinetask`.
* testing/lisp/test-org-clock.el: Require `org-duration` and `org-clock`.
* testing/lisp/test-org-archive.el: Require `org-archive`.
* testing/lisp/test-org-agenda.el
(test-org-agenda/bulk-custom-arg-func): Add FIXME.
* testing/lisp/test-ol.el: Require `ol` and `org-id`.
(test-org-link/store-link): Declare `org-store-link-props` and add FIXME.
* testing/lisp/test-oc.el (test-org-cite/export-capability): Add FIXME.
* testing/lisp/test-ob.el: Require `ob-core`, `org-src`, `ob-ref`,
and `org-table`.
(test-ob/eval-header-argument): Rename `foo` to `test-ob--foo` and
declare it as dynbound.
(test-ob/blocks-with-spaces, test-ob/specific-colnames): Add FIXME.
(test-ob/noweb-expansions-in-cache):
Declare `noweb-expansions-in-cache-var` as dynbound.
* testing/lisp/test-ob-tangle.el: Require `org` and `ob-tangle`.
* testing/lisp/test-ob-shell.el:
* testing/lisp/test-ob-python.el: Require `ob-core`.
* testing/lisp/test-ob-lob.el: Require `ob-lob`.
(temporary-value-for-test): Declare as dynbound.
* testing/lisp/test-ob-plantuml.el: Require `ob-plantuml` instead of
erroring out if it's not already loaded.
* testing/lisp/test-ob-lilypond.el: Require `ob-lilypond` instead of
erroring out if it's not already loaded. Use `with-current-buffer`.
* testing/lisp/test-ob-julia.el: Require `ob-core`.
* testing/lisp/test-ob-java.el (org-babel-temporary-directory):
Remove dead code now that `org-babel-temporary-directory` is always bound.
* testing/lisp/test-ob-exp.el: Require `ob-exp`, `org-src`, and `org-test`.
(ob-exp/evaluate-all-executables-in-order):
Declare `*evaluation-collector*` as dynbound.
* testing/lisp/test-ob-emacs-lisp.el (ob-emacs-lisp/dynamic-lexical-edit)
(ob-emacs-lisp/dynamic-lexical-execute):
Rename dynbound var to `ob-emacs--x` and declare it as such.
* testing/lisp/test-ob-R.el: Require `ob-core`.
(ess-ask-for-ess-directory, ess-history-file): Declare vars.
2022-09-14 17:21:37 -04:00
|
|
|
(with-current-buffer (get-buffer-create "test-ob-lilypond.el")
|
2014-08-20 15:10:00 -04:00
|
|
|
(setq org-babel-lilypond-here
|
2011-07-01 15:22:05 -04:00
|
|
|
(file-name-directory
|
2011-07-04 14:04:43 -04:00
|
|
|
(or load-file-name (buffer-file-name)))))
|
|
|
|
|
2011-07-01 15:22:05 -04:00
|
|
|
(ert-deftest ob-lilypond/feature-provision ()
|
|
|
|
(should (featurep 'ob-lilypond)))
|
2012-03-21 10:27:23 -04:00
|
|
|
|
2011-07-01 15:22:05 -04:00
|
|
|
(ert-deftest ob-lilypond/org-babel-tangle-lang-exts ()
|
|
|
|
(let ((found nil)
|
|
|
|
(list org-babel-tangle-lang-exts))
|
|
|
|
(while list
|
|
|
|
(when (equal (car list) '("LilyPond" . "ly"))
|
|
|
|
(setq found t))
|
|
|
|
(setq list (cdr list)))
|
|
|
|
(should found)))
|
2012-03-21 10:27:23 -04:00
|
|
|
|
2011-07-01 15:22:05 -04:00
|
|
|
(ert-deftest ob-lilypond/org-babel-prep-session:lilypond ()
|
|
|
|
(should-error (org-babel-prep-session:lilypond nil nil))
|
|
|
|
:type 'error)
|
|
|
|
|
|
|
|
(ert-deftest ob-lilypond/ly-compile-lilyfile ()
|
2023-08-24 09:32:27 -04:00
|
|
|
(cl-letf (((symbol-function 'call-process) 'list)
|
|
|
|
(org-babel-lilypond-gen-png nil)
|
|
|
|
(org-babel-lilypond-gen-html nil)
|
|
|
|
(org-babel-lilypond-use-eps nil)
|
|
|
|
(org-babel-lilypond-gen-svg nil))
|
|
|
|
(should (equal
|
|
|
|
`(,org-babel-lilypond-ly-command ;program
|
|
|
|
nil ;infile
|
|
|
|
"*lilypond*" ;buffer
|
|
|
|
display
|
|
|
|
,@(when org-babel-lilypond-gen-png '("--png")) ;&rest...
|
|
|
|
,@(when org-babel-lilypond-gen-html '("--html"))
|
|
|
|
,@(when org-babel-lilypond-gen-pdf '("--pdf"))
|
|
|
|
,@(when org-babel-lilypond-use-eps '("-dbackend=eps"))
|
|
|
|
,@(when org-babel-lilypond-gen-svg '("-dbackend=svg"))
|
|
|
|
"--output=test-file"
|
|
|
|
"test-file.ly")
|
|
|
|
(org-babel-lilypond-compile-lilyfile "test-file.ly")))))
|
2011-07-01 15:22:05 -04:00
|
|
|
|
|
|
|
(ert-deftest ob-lilypond/ly-compile-post-tangle ()
|
2014-08-20 15:10:00 -04:00
|
|
|
(should (boundp 'org-babel-lilypond-compile-post-tangle)))
|
2011-07-01 15:22:05 -04:00
|
|
|
|
|
|
|
(ert-deftest ob-lilypond/ly-display-pdf-post-tangle ()
|
2014-08-20 15:10:00 -04:00
|
|
|
(should (boundp 'org-babel-lilypond-display-pdf-post-tangle)))
|
2011-07-01 15:22:05 -04:00
|
|
|
|
|
|
|
(ert-deftest ob-lilypond/ly-play-midi-post-tangle ()
|
2014-08-20 15:10:00 -04:00
|
|
|
(should (boundp 'org-babel-lilypond-play-midi-post-tangle)))
|
2011-07-01 15:22:05 -04:00
|
|
|
|
ob-lilypond: Code cleanup
* lisp/ob-lilypond.el (org-babel-lilypond-OSX-ly-path,
org-babel-lilypond-OSX-pdf-path, org-babel-lilypond-OSX-midi-path,
org-babel-lilypond-nix-ly-path, org-babel-lilypond-nix-pdf-path,
org-babel-lilypond-nix-midi-path, org-babel-lilypond-w32-ly-path,
org-babel-lilypond-w32-pdf-path, org-babel-lilypond-w32-midi-path,
org-babel-lilypond-determine-ly-path,
org-babel-lilypond-determine-pdf-path,
org-babel-lilypond-determine-midi-path): Remove.
(org-babel-lilypond-ly-command, org-babel-lilypond-midi-command,
org-babel-lilypond-pdf-command): Replacement for removed variables
and functions. Adapt all calls to the removed functions to use
these variables instead.
(org-babel-lilypond-commands): New defcustom for setting up
the *-command variables. Keep different defaults for different
systems as the original code did to avoid tripping up unsuspecting
users.
(org-babel-lilypond-execute-tangled-ly,
org-babel-lilypond-check-for-compile-error): Revert conditions to
avoid superfluous forms. Remove unused return values.
* testing/lisp/test-ob-lilypond.el: Do test for new variables and
replace removed function calls with the appropriate variable
content. Exercise the new defcustom thoroughly.
2014-08-17 04:29:24 -04:00
|
|
|
(ert-deftest ob-lilypond/ly-command-ly/bound ()
|
|
|
|
(should (boundp 'org-babel-lilypond-ly-command)))
|
|
|
|
(ert-deftest ob-lilypond/ly-command-ly/stringp ()
|
|
|
|
(should (stringp org-babel-lilypond-ly-command)))
|
|
|
|
(ert-deftest ob-lilypond/ly-command-pdf/bound ()
|
|
|
|
(should (boundp 'org-babel-lilypond-pdf-command)))
|
|
|
|
(ert-deftest ob-lilypond/ly-command-pdf/stringp ()
|
|
|
|
(should (stringp org-babel-lilypond-pdf-command)))
|
|
|
|
(ert-deftest ob-lilypond/ly-command-midi/bound ()
|
|
|
|
(should (boundp 'org-babel-lilypond-midi-command)))
|
|
|
|
(ert-deftest ob-lilypond/ly-command-midi/stringp ()
|
|
|
|
(should (stringp org-babel-lilypond-midi-command)))
|
|
|
|
(ert-deftest ob-lilypond/ly-commands/darwin ()
|
|
|
|
(let ((system-type 'darwin)
|
|
|
|
org-babel-lilypond-ly-command
|
|
|
|
org-babel-lilypond-pdf-command
|
|
|
|
org-babel-lilypond-midi-command)
|
|
|
|
(custom-reevaluate-setting 'org-babel-lilypond-commands)
|
|
|
|
(should (equal
|
|
|
|
(list
|
|
|
|
org-babel-lilypond-ly-command
|
|
|
|
org-babel-lilypond-pdf-command
|
|
|
|
org-babel-lilypond-midi-command)
|
|
|
|
(list
|
|
|
|
"/Applications/lilypond.app/Contents/Resources/bin/lilypond"
|
|
|
|
"open"
|
|
|
|
"open"))))
|
|
|
|
(custom-reevaluate-setting 'org-babel-lilypond-commands))
|
|
|
|
(ert-deftest ob-lilypond/ly-commands/windows-nt ()
|
|
|
|
(let ((system-type 'windows-nt)
|
|
|
|
org-babel-lilypond-ly-command
|
|
|
|
org-babel-lilypond-pdf-command
|
|
|
|
org-babel-lilypond-midi-command)
|
|
|
|
(custom-reevaluate-setting 'org-babel-lilypond-commands)
|
|
|
|
(should (equal
|
|
|
|
(list
|
|
|
|
org-babel-lilypond-ly-command
|
|
|
|
org-babel-lilypond-pdf-command
|
|
|
|
org-babel-lilypond-midi-command)
|
|
|
|
(list
|
|
|
|
"lilypond"
|
|
|
|
""
|
|
|
|
""))))
|
|
|
|
(custom-reevaluate-setting 'org-babel-lilypond-commands))
|
|
|
|
(ert-deftest ob-lilypond/ly-commands/other ()
|
|
|
|
(let ((system-type 'other)
|
|
|
|
org-babel-lilypond-ly-command
|
|
|
|
org-babel-lilypond-pdf-command
|
|
|
|
org-babel-lilypond-midi-command)
|
|
|
|
(custom-reevaluate-setting 'org-babel-lilypond-commands)
|
|
|
|
(should (equal
|
|
|
|
(list
|
|
|
|
org-babel-lilypond-ly-command
|
|
|
|
org-babel-lilypond-pdf-command
|
|
|
|
org-babel-lilypond-midi-command)
|
|
|
|
(list
|
|
|
|
"lilypond"
|
|
|
|
"xdg-open"
|
|
|
|
"xdg-open"))))
|
|
|
|
(custom-reevaluate-setting 'org-babel-lilypond-commands))
|
|
|
|
|
2011-07-01 15:22:05 -04:00
|
|
|
(ert-deftest ob-lilypond/ly-gen-png ()
|
2014-08-20 15:10:00 -04:00
|
|
|
(should (boundp 'org-babel-lilypond-gen-png)))
|
2011-07-01 15:22:05 -04:00
|
|
|
|
|
|
|
(ert-deftest ob-lilypond/ly-gen-svg ()
|
2014-08-20 15:10:00 -04:00
|
|
|
(should (boundp 'org-babel-lilypond-gen-svg)))
|
2011-07-01 15:22:05 -04:00
|
|
|
|
|
|
|
(ert-deftest ob-lilypond/ly-gen-html ()
|
2014-08-20 15:10:00 -04:00
|
|
|
(should (boundp 'org-babel-lilypond-gen-html)))
|
2011-07-01 15:22:05 -04:00
|
|
|
|
2017-09-08 07:20:48 -04:00
|
|
|
(ert-deftest ob-lilypond/ly-gen-pdf ()
|
2014-08-20 15:10:00 -04:00
|
|
|
(should (boundp 'org-babel-lilypond-gen-pdf)))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
2011-07-01 15:22:05 -04:00
|
|
|
(ert-deftest ob-lilypond/use-eps ()
|
2014-08-20 15:10:00 -04:00
|
|
|
(should (boundp 'org-babel-lilypond-use-eps)))
|
2011-07-01 15:22:05 -04:00
|
|
|
|
2011-07-06 09:17:29 -04:00
|
|
|
(ert-deftest ob-lilypond/ly-arrange-mode ()
|
2014-08-20 15:10:00 -04:00
|
|
|
(should (boundp 'org-babel-lilypond-arrange-mode)))
|
2011-07-06 09:17:29 -04:00
|
|
|
|
|
|
|
;; (ert-deftest ob-lilypond/org-babel-default-header-args:lilypond ()
|
|
|
|
;; (should (equal '((:tangle . "yes")
|
|
|
|
;; (:noweb . "yes")
|
|
|
|
;; (:results . "silent")
|
|
|
|
;; (:comments . "yes"))
|
|
|
|
;; org-babel-default-header-args:lilypond)))
|
2011-07-01 15:22:05 -04:00
|
|
|
|
|
|
|
;;TODO finish...
|
|
|
|
(ert-deftest ob-lilypond/org-babel-expand-body:lilypond ()
|
|
|
|
(should (equal "This is a test"
|
|
|
|
(org-babel-expand-body:lilypond "This is a test" ()))))
|
|
|
|
|
2014-08-20 15:10:00 -04:00
|
|
|
;;TODO (ert-deftest org-babel-lilypond-test-org-babel-execute:lilypond ())
|
2011-07-01 15:22:05 -04:00
|
|
|
(ert-deftest ob-lilypond/ly-check-for-compile-error ()
|
|
|
|
(set-buffer (get-buffer-create "*lilypond*"))
|
|
|
|
(erase-buffer)
|
2014-08-20 15:10:00 -04:00
|
|
|
(should (not (org-babel-lilypond-check-for-compile-error nil t)))
|
|
|
|
(insert-file-contents (concat org-babel-lilypond-here
|
2011-07-01 15:22:05 -04:00
|
|
|
"../examples/ob-lilypond-test.error")
|
|
|
|
nil nil nil t)
|
|
|
|
(goto-char (point-min))
|
2014-08-20 15:10:00 -04:00
|
|
|
(should (org-babel-lilypond-check-for-compile-error nil t))
|
2011-07-01 15:22:05 -04:00
|
|
|
(kill-buffer "*lilypond*"))
|
|
|
|
|
|
|
|
(ert-deftest ob-lilypond/ly-process-compile-error ()
|
|
|
|
(find-file-other-window (concat
|
2014-08-20 15:10:00 -04:00
|
|
|
org-babel-lilypond-here
|
2011-07-01 15:22:05 -04:00
|
|
|
"../examples/ob-lilypond-broken.org"))
|
|
|
|
(set-buffer (get-buffer-create "*lilypond*"))
|
|
|
|
(insert-file-contents (concat
|
2014-08-20 15:10:00 -04:00
|
|
|
org-babel-lilypond-here
|
2011-07-01 15:22:05 -04:00
|
|
|
"../examples/ob-lilypond-test.error")
|
|
|
|
nil nil nil t)
|
|
|
|
(goto-char (point-min))
|
|
|
|
(search-forward "error:" nil t)
|
|
|
|
(should-error
|
2014-08-20 15:10:00 -04:00
|
|
|
(org-babel-lilypond-process-compile-error (concat
|
|
|
|
org-babel-lilypond-here
|
2011-07-01 15:22:05 -04:00
|
|
|
"../examples/ob-lilypond-broken.ly"))
|
|
|
|
:type 'error)
|
|
|
|
(set-buffer "ob-lilypond-broken.org")
|
|
|
|
(should (equal 238 (point)))
|
|
|
|
(exchange-point-and-mark)
|
|
|
|
(should (equal (+ 238 (length "line 25")) (point)))
|
|
|
|
(kill-buffer "*lilypond*")
|
|
|
|
(kill-buffer "ob-lilypond-broken.org"))
|
2012-03-21 10:27:23 -04:00
|
|
|
|
2011-07-01 15:22:05 -04:00
|
|
|
(ert-deftest ob-lilypond/ly-mark-error-line ()
|
|
|
|
(let ((file-name (concat
|
2014-08-20 15:10:00 -04:00
|
|
|
org-babel-lilypond-here
|
2011-07-01 15:22:05 -04:00
|
|
|
"../examples/ob-lilypond-broken.org"))
|
|
|
|
(expected-point-min 198)
|
|
|
|
(expected-point-max 205)
|
|
|
|
(line "line 20"))
|
|
|
|
(find-file-other-window file-name)
|
2014-08-20 15:10:00 -04:00
|
|
|
(org-babel-lilypond-mark-error-line file-name line)
|
2011-07-01 15:22:05 -04:00
|
|
|
(should (equal expected-point-min (point)))
|
2012-03-21 10:27:23 -04:00
|
|
|
|
2011-07-01 15:22:05 -04:00
|
|
|
(exchange-point-and-mark)
|
|
|
|
(should (= expected-point-max (point)))
|
|
|
|
(kill-buffer (file-name-nondirectory file-name))))
|
|
|
|
|
|
|
|
(ert-deftest ob-lilypond/ly-parse-line-num ()
|
|
|
|
(with-temp-buffer
|
|
|
|
(insert-file-contents (concat
|
2014-08-20 15:10:00 -04:00
|
|
|
org-babel-lilypond-here
|
2011-07-01 15:22:05 -04:00
|
|
|
"../examples/ob-lilypond-test.error")
|
|
|
|
nil nil nil t)
|
|
|
|
(goto-char (point-min))
|
|
|
|
(search-forward "error:")
|
2014-08-20 15:10:00 -04:00
|
|
|
(should (equal 25 (org-babel-lilypond-parse-line-num (current-buffer))))))
|
2012-03-21 10:27:23 -04:00
|
|
|
|
2011-07-01 15:22:05 -04:00
|
|
|
(ert-deftest ob-lilypond/ly-parse-error-line ()
|
2014-08-20 15:10:00 -04:00
|
|
|
(let ((org-babel-lilypond-file (concat
|
|
|
|
org-babel-lilypond-here
|
2011-07-01 15:22:05 -04:00
|
|
|
"../examples/ob-lilypond-broken.ly")))
|
|
|
|
(should (equal "line 20"
|
2014-08-20 15:10:00 -04:00
|
|
|
(org-babel-lilypond-parse-error-line org-babel-lilypond-file 20)))
|
|
|
|
(should (not (org-babel-lilypond-parse-error-line org-babel-lilypond-file 0)))))
|
2012-03-21 10:27:23 -04:00
|
|
|
|
2011-07-01 15:22:05 -04:00
|
|
|
(ert-deftest ob-lilypond/ly-attempt-to-open-pdf ()
|
2014-08-20 15:10:00 -04:00
|
|
|
(let ((post-tangle org-babel-lilypond-display-pdf-post-tangle)
|
|
|
|
(org-babel-lilypond-file (concat
|
|
|
|
org-babel-lilypond-here
|
2011-07-01 15:22:05 -04:00
|
|
|
"../examples/ob-lilypond-test.ly"))
|
|
|
|
(pdf-file (concat
|
2014-08-20 15:10:00 -04:00
|
|
|
org-babel-lilypond-here
|
2011-07-01 15:22:05 -04:00
|
|
|
"../examples/ob-lilypond-test.pdf")))
|
2014-08-20 15:10:00 -04:00
|
|
|
(setq org-babel-lilypond-display-pdf-post-tangle t)
|
2011-07-01 15:22:05 -04:00
|
|
|
(when (not (file-exists-p pdf-file))
|
|
|
|
(set-buffer (get-buffer-create (file-name-nondirectory pdf-file)))
|
|
|
|
(write-file pdf-file))
|
2012-03-21 10:27:23 -04:00
|
|
|
(should (equal
|
2011-07-01 15:22:05 -04:00
|
|
|
(concat
|
ob-lilypond: Code cleanup
* lisp/ob-lilypond.el (org-babel-lilypond-OSX-ly-path,
org-babel-lilypond-OSX-pdf-path, org-babel-lilypond-OSX-midi-path,
org-babel-lilypond-nix-ly-path, org-babel-lilypond-nix-pdf-path,
org-babel-lilypond-nix-midi-path, org-babel-lilypond-w32-ly-path,
org-babel-lilypond-w32-pdf-path, org-babel-lilypond-w32-midi-path,
org-babel-lilypond-determine-ly-path,
org-babel-lilypond-determine-pdf-path,
org-babel-lilypond-determine-midi-path): Remove.
(org-babel-lilypond-ly-command, org-babel-lilypond-midi-command,
org-babel-lilypond-pdf-command): Replacement for removed variables
and functions. Adapt all calls to the removed functions to use
these variables instead.
(org-babel-lilypond-commands): New defcustom for setting up
the *-command variables. Keep different defaults for different
systems as the original code did to avoid tripping up unsuspecting
users.
(org-babel-lilypond-execute-tangled-ly,
org-babel-lilypond-check-for-compile-error): Revert conditions to
avoid superfluous forms. Remove unused return values.
* testing/lisp/test-ob-lilypond.el: Do test for new variables and
replace removed function calls with the appropriate variable
content. Exercise the new defcustom thoroughly.
2014-08-17 04:29:24 -04:00
|
|
|
org-babel-lilypond-pdf-command " " pdf-file)
|
2014-08-20 15:10:00 -04:00
|
|
|
(org-babel-lilypond-attempt-to-open-pdf org-babel-lilypond-file t)))
|
2011-07-01 15:22:05 -04:00
|
|
|
(delete-file pdf-file)
|
|
|
|
(kill-buffer (file-name-nondirectory pdf-file))
|
2015-11-08 11:31:34 -05:00
|
|
|
(should (string-prefix-p "No pdf file generated"
|
|
|
|
(org-babel-lilypond-attempt-to-open-pdf pdf-file)))
|
2014-08-20 15:10:00 -04:00
|
|
|
(setq org-babel-lilypond-display-pdf-post-tangle post-tangle)))
|
2011-07-01 15:22:05 -04:00
|
|
|
|
|
|
|
(ert-deftest ob-lilypond/ly-attempt-to-play-midi ()
|
2014-08-20 15:10:00 -04:00
|
|
|
(let ((post-tangle org-babel-lilypond-play-midi-post-tangle)
|
|
|
|
(org-babel-lilypond-file (concat
|
|
|
|
org-babel-lilypond-here
|
2011-07-01 15:22:05 -04:00
|
|
|
"../examples/ob-lilypond-test.ly"))
|
|
|
|
(midi-file (concat
|
2014-08-20 15:10:00 -04:00
|
|
|
org-babel-lilypond-here
|
2011-07-01 15:22:05 -04:00
|
|
|
"../examples/ob-lilypond-test.midi")))
|
2014-08-20 15:10:00 -04:00
|
|
|
(setq org-babel-lilypond-play-midi-post-tangle t)
|
2011-07-01 15:22:05 -04:00
|
|
|
(when (not (file-exists-p midi-file))
|
|
|
|
(set-buffer (get-buffer-create (file-name-nondirectory midi-file)))
|
|
|
|
(write-file midi-file))
|
|
|
|
(should (equal
|
|
|
|
(concat
|
ob-lilypond: Code cleanup
* lisp/ob-lilypond.el (org-babel-lilypond-OSX-ly-path,
org-babel-lilypond-OSX-pdf-path, org-babel-lilypond-OSX-midi-path,
org-babel-lilypond-nix-ly-path, org-babel-lilypond-nix-pdf-path,
org-babel-lilypond-nix-midi-path, org-babel-lilypond-w32-ly-path,
org-babel-lilypond-w32-pdf-path, org-babel-lilypond-w32-midi-path,
org-babel-lilypond-determine-ly-path,
org-babel-lilypond-determine-pdf-path,
org-babel-lilypond-determine-midi-path): Remove.
(org-babel-lilypond-ly-command, org-babel-lilypond-midi-command,
org-babel-lilypond-pdf-command): Replacement for removed variables
and functions. Adapt all calls to the removed functions to use
these variables instead.
(org-babel-lilypond-commands): New defcustom for setting up
the *-command variables. Keep different defaults for different
systems as the original code did to avoid tripping up unsuspecting
users.
(org-babel-lilypond-execute-tangled-ly,
org-babel-lilypond-check-for-compile-error): Revert conditions to
avoid superfluous forms. Remove unused return values.
* testing/lisp/test-ob-lilypond.el: Do test for new variables and
replace removed function calls with the appropriate variable
content. Exercise the new defcustom thoroughly.
2014-08-17 04:29:24 -04:00
|
|
|
org-babel-lilypond-midi-command " " midi-file)
|
2014-08-20 15:10:00 -04:00
|
|
|
(org-babel-lilypond-attempt-to-play-midi org-babel-lilypond-file t)))
|
2011-07-01 15:22:05 -04:00
|
|
|
(delete-file midi-file)
|
|
|
|
(kill-buffer (file-name-nondirectory midi-file))
|
2015-11-08 11:31:34 -05:00
|
|
|
(should (string-prefix-p
|
|
|
|
"No midi file generated"
|
2014-08-20 15:10:00 -04:00
|
|
|
(org-babel-lilypond-attempt-to-play-midi midi-file)))
|
|
|
|
(setq org-babel-lilypond-play-midi-post-tangle post-tangle)))
|
2011-07-01 15:22:05 -04:00
|
|
|
|
|
|
|
(ert-deftest ob-lilypond/ly-toggle-midi-play-toggles-flag ()
|
2014-08-20 15:10:00 -04:00
|
|
|
(if org-babel-lilypond-play-midi-post-tangle
|
2011-07-01 15:22:05 -04:00
|
|
|
(progn
|
2014-08-20 15:10:00 -04:00
|
|
|
(org-babel-lilypond-toggle-midi-play)
|
|
|
|
(should (not org-babel-lilypond-play-midi-post-tangle))
|
|
|
|
(org-babel-lilypond-toggle-midi-play)
|
|
|
|
(should org-babel-lilypond-play-midi-post-tangle))
|
|
|
|
(org-babel-lilypond-toggle-midi-play)
|
|
|
|
(should org-babel-lilypond-play-midi-post-tangle)
|
|
|
|
(org-babel-lilypond-toggle-midi-play)
|
|
|
|
(should (not org-babel-lilypond-play-midi-post-tangle))))
|
2011-07-01 15:22:05 -04:00
|
|
|
|
|
|
|
(ert-deftest ob-lilypond/ly-toggle-pdf-display-toggles-flag ()
|
2014-08-20 15:10:00 -04:00
|
|
|
(if org-babel-lilypond-display-pdf-post-tangle
|
2011-07-01 15:22:05 -04:00
|
|
|
(progn
|
2014-08-20 15:10:00 -04:00
|
|
|
(org-babel-lilypond-toggle-pdf-display)
|
|
|
|
(should (not org-babel-lilypond-display-pdf-post-tangle))
|
|
|
|
(org-babel-lilypond-toggle-pdf-display)
|
|
|
|
(should org-babel-lilypond-display-pdf-post-tangle))
|
|
|
|
(org-babel-lilypond-toggle-pdf-display)
|
|
|
|
(should org-babel-lilypond-display-pdf-post-tangle)
|
|
|
|
(org-babel-lilypond-toggle-pdf-display)
|
|
|
|
(should (not org-babel-lilypond-display-pdf-post-tangle))))
|
2011-07-01 15:22:05 -04:00
|
|
|
|
2012-03-19 16:38:12 -04:00
|
|
|
(ert-deftest ob-lilypond/ly-toggle-pdf-generation-toggles-flag ()
|
2014-08-20 15:10:00 -04:00
|
|
|
(if org-babel-lilypond-gen-pdf
|
2012-03-19 16:38:12 -04:00
|
|
|
(progn
|
2014-08-20 15:10:00 -04:00
|
|
|
(org-babel-lilypond-toggle-pdf-generation)
|
|
|
|
(should (not org-babel-lilypond-gen-pdf))
|
|
|
|
(org-babel-lilypond-toggle-pdf-generation)
|
|
|
|
(should org-babel-lilypond-gen-pdf))
|
|
|
|
(org-babel-lilypond-toggle-pdf-generation)
|
|
|
|
(should org-babel-lilypond-gen-pdf)
|
|
|
|
(org-babel-lilypond-toggle-pdf-generation)
|
|
|
|
(should (not org-babel-lilypond-gen-pdf))))
|
2012-03-19 16:38:12 -04:00
|
|
|
|
2011-07-06 09:17:29 -04:00
|
|
|
(ert-deftest ob-lilypond/ly-toggle-arrange-mode ()
|
2014-08-20 15:10:00 -04:00
|
|
|
(if org-babel-lilypond-arrange-mode
|
2011-07-06 09:17:29 -04:00
|
|
|
(progn
|
2014-08-20 15:10:00 -04:00
|
|
|
(org-babel-lilypond-toggle-arrange-mode)
|
|
|
|
(should (not org-babel-lilypond-arrange-mode))
|
|
|
|
(org-babel-lilypond-toggle-arrange-mode)
|
|
|
|
(should org-babel-lilypond-arrange-mode))
|
|
|
|
(org-babel-lilypond-toggle-arrange-mode)
|
|
|
|
(should org-babel-lilypond-arrange-mode)
|
|
|
|
(org-babel-lilypond-toggle-arrange-mode)
|
|
|
|
(should (not org-babel-lilypond-arrange-mode))))
|
2011-07-06 09:17:29 -04:00
|
|
|
|
2011-07-01 15:22:05 -04:00
|
|
|
(ert-deftest ob-lilypond/ly-toggle-png-generation-toggles-flag ()
|
2014-08-20 15:10:00 -04:00
|
|
|
(if org-babel-lilypond-gen-png
|
2011-07-01 15:22:05 -04:00
|
|
|
(progn
|
2014-08-20 15:10:00 -04:00
|
|
|
(org-babel-lilypond-toggle-png-generation)
|
|
|
|
(should (not org-babel-lilypond-gen-png))
|
|
|
|
(org-babel-lilypond-toggle-png-generation)
|
|
|
|
(should org-babel-lilypond-gen-png))
|
|
|
|
(org-babel-lilypond-toggle-png-generation)
|
|
|
|
(should org-babel-lilypond-gen-png)
|
|
|
|
(org-babel-lilypond-toggle-png-generation)
|
|
|
|
(should (not org-babel-lilypond-gen-png))))
|
2012-03-21 10:27:23 -04:00
|
|
|
|
2011-07-01 15:22:05 -04:00
|
|
|
(ert-deftest ob-lilypond/ly-toggle-html-generation-toggles-flag ()
|
2014-08-20 15:10:00 -04:00
|
|
|
(if org-babel-lilypond-gen-html
|
2011-07-01 15:22:05 -04:00
|
|
|
(progn
|
2014-08-20 15:10:00 -04:00
|
|
|
(org-babel-lilypond-toggle-html-generation)
|
|
|
|
(should (not org-babel-lilypond-gen-html))
|
|
|
|
(org-babel-lilypond-toggle-html-generation)
|
|
|
|
(should org-babel-lilypond-gen-html))
|
|
|
|
(org-babel-lilypond-toggle-html-generation)
|
|
|
|
(should org-babel-lilypond-gen-html)
|
|
|
|
(org-babel-lilypond-toggle-html-generation)
|
|
|
|
(should (not org-babel-lilypond-gen-html))))
|
2011-07-01 15:22:05 -04:00
|
|
|
|
|
|
|
(ert-deftest ob-lilypond/ly-switch-extension-with-extensions ()
|
|
|
|
(should (equal "test-name.xyz"
|
2014-08-20 15:10:00 -04:00
|
|
|
(org-babel-lilypond-switch-extension "test-name" ".xyz")))
|
2011-07-01 15:22:05 -04:00
|
|
|
(should (equal "test-name.xyz"
|
2014-08-20 15:10:00 -04:00
|
|
|
(org-babel-lilypond-switch-extension "test-name.abc" ".xyz")))
|
2011-07-01 15:22:05 -04:00
|
|
|
(should (equal "test-name"
|
2014-08-20 15:10:00 -04:00
|
|
|
(org-babel-lilypond-switch-extension "test-name.abc" ""))))
|
2011-07-01 15:22:05 -04:00
|
|
|
|
|
|
|
(ert-deftest ob-lilypond/ly-switch-extension-with-paths ()
|
|
|
|
(should (equal "/some/path/to/test-name.xyz"
|
2014-08-20 15:10:00 -04:00
|
|
|
(org-babel-lilypond-switch-extension "/some/path/to/test-name" ".xyz"))))
|
2011-07-01 15:22:05 -04:00
|
|
|
|
2011-07-06 09:17:29 -04:00
|
|
|
(ert-deftest ob-lilypond/ly-get-header-args ()
|
|
|
|
(should (equal '((:tangle . "yes")
|
|
|
|
(:noweb . "yes")
|
|
|
|
(:results . "silent")
|
2012-03-19 16:38:12 -04:00
|
|
|
(:cache . "yes")
|
2011-07-06 09:17:29 -04:00
|
|
|
(:comments . "yes"))
|
2014-08-20 15:10:00 -04:00
|
|
|
(org-babel-lilypond-set-header-args t)))
|
2011-07-06 09:17:29 -04:00
|
|
|
(should (equal '((:results . "file")
|
|
|
|
(:exports . "results"))
|
2014-08-20 15:10:00 -04:00
|
|
|
(org-babel-lilypond-set-header-args nil))))
|
2011-07-06 09:17:29 -04:00
|
|
|
|
|
|
|
(ert-deftest ob-lilypond/ly-set-header-args ()
|
2014-08-20 15:10:00 -04:00
|
|
|
(org-babel-lilypond-set-header-args t)
|
2011-07-06 09:17:29 -04:00
|
|
|
(should (equal '((:tangle . "yes")
|
|
|
|
(:noweb . "yes")
|
|
|
|
(:results . "silent")
|
2012-03-19 16:38:12 -04:00
|
|
|
(:cache . "yes")
|
2011-07-06 09:17:29 -04:00
|
|
|
(:comments . "yes"))
|
|
|
|
org-babel-default-header-args:lilypond))
|
2014-08-20 15:10:00 -04:00
|
|
|
(org-babel-lilypond-set-header-args nil)
|
2011-07-06 09:17:29 -04:00
|
|
|
(should (equal '((:results . "file")
|
|
|
|
(:exports . "results"))
|
|
|
|
org-babel-default-header-args:lilypond)))
|
2012-03-21 10:27:23 -04:00
|
|
|
|
2011-07-01 15:22:05 -04:00
|
|
|
(provide 'test-ob-lilypond)
|
|
|
|
|
|
|
|
;;; test-ob-lilypond.el ends here
|