Skip to content

Commit

Permalink
Add tests for markdown-command
Browse files Browse the repository at this point in the history
  • Loading branch information
syohex committed May 10, 2020
1 parent 8215550 commit de4b659
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ jobs:
version: ${{ matrix.emacs_version }}

- uses: actions/checkout@v1
- name: Install dependencies
run: sudo apt install pandoc
- name: Run tests
run: |
make clean
Expand Down
19 changes: 19 additions & 0 deletions tests/markdown-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -6211,6 +6211,25 @@ https://github.com/jrblevin/markdown-mode/issues/235"
(should (buffer-live-p buffer))
(should (equal calls `((1 4 ,buffer)))))))

(ert-deftest test-markdown-command/string-command ()
"Test `markdown-command' for string which has only command."
(markdown-test-string "foo"
(let ((markdown-command "pandoc"))
;; check exception is not thrown
(should (markdown)))))

(ert-deftest test-markdown-command/string-command-with-options ()
"Test `markdown-command' for string which has command and options."
(markdown-test-string "foo"
(let ((markdown-command "pandoc --from=markdown --to=html5"))
(should (markdown)))))

(ert-deftest test-markdown-command/list-of-strings ()
"Test `markdown-command' for list of strings."
(markdown-test-string "foo"
(let ((markdown-command '("pandoc" "--from=markdown" "--to=html5")))
(should (markdown)))))

(ert-deftest test-markdown-command/does-not-exist ()
"Test ‘markdown’ with a non-existing ‘markdown-command’."
(skip-unless (not (file-executable-p "/does/not/exist")))
Expand Down

0 comments on commit de4b659

Please sign in to comment.