diff options
Diffstat (limited to 'test/pdf-loader-test.el')
| -rw-r--r-- | test/pdf-loader-test.el | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/pdf-loader-test.el b/test/pdf-loader-test.el new file mode 100644 index 0000000..a7bc79f --- /dev/null +++ b/test/pdf-loader-test.el @@ -0,0 +1,24 @@ +;; -*- lexical-binding: t -*- + +(require 'pdf-loader) +(require 'ert) +(require 'cl-lib) + +(ert-deftest pdf-loader-activation () + :expected-result :failed ;; Until someone figures out how to run the + ;; tests w/o loading all of the package. + (should-not (memq 'pdf-tools features)) + (pdf-loader-install) + (with-current-buffer (find-file "test.pdf") + (should (eq major-mode 'pdf-view-mode)))) + +(ert-deftest pdf-loader-install/uninstall-alists () + (cl-labels ((alists-installed-p () + (and (assoc pdf-loader--auto-mode-alist-item + auto-mode-alist) + (assoc pdf-loader--magic-mode-alist-item + magic-mode-alist)))) + (pdf-loader--install #'ignore) + (should (alists-installed-p)) + (pdf-loader--uninstall) + (should-not (alists-installed-p)))) |
