dotemacs

My Emacs configuration
git clone git://git.entf.net/dotemacs
Log | Files | Refs | LICENSE

pdf-loader-test.el (865B)


      1 ;; -*- lexical-binding: t -*-
      2 
      3 (require 'pdf-loader)
      4 (require 'ert)
      5 (require 'cl-lib)
      6 
      7 (ert-deftest pdf-loader-activation ()
      8   :expected-result :failed ;; Until someone figures out how to run the
      9                            ;; tests w/o loading all of the package.
     10   (should-not (memq 'pdf-tools features))
     11   (pdf-loader-install)
     12   (with-current-buffer (find-file "test.pdf")
     13     (should (eq major-mode 'pdf-view-mode))))
     14 
     15 (ert-deftest pdf-loader-install/uninstall-alists ()
     16   (cl-labels ((alists-installed-p ()
     17                 (and (assoc pdf-loader--auto-mode-alist-item
     18                             auto-mode-alist)
     19                      (assoc pdf-loader--magic-mode-alist-item
     20                             magic-mode-alist))))
     21     (pdf-loader--install #'ignore)
     22     (should (alists-installed-p))
     23     (pdf-loader--uninstall)
     24     (should-not (alists-installed-p))))