blob: 26b7fe7ff71387df4a9185c48574123878e4c1e3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
;; * ================================================================== *
;; * Tests for pdf-cache.el
;; * ================================================================== *
(require 'pdf-cache)
(require 'ert)
(ert-deftest pdf-cache-get-image ()
(let (pdf-cache--image-cache)
(should-not (pdf-cache-get-image 1 1))
(setq pdf-cache--image-cache
(list
(pdf-cache--make-image 1 1 "1" nil)
(pdf-cache--make-image 2 1 "2" nil)
(pdf-cache--make-image 3 1 "3" nil)))
(should (equal (pdf-cache-get-image 1 1) "1"))
(should (equal pdf-cache--image-cache
(list
(pdf-cache--make-image 1 1 "1" nil)
(pdf-cache--make-image 2 1 "2" nil)
(pdf-cache--make-image 3 1 "3" nil))))
(should (equal (pdf-cache-get-image 2 1) "2"))
(should (equal pdf-cache--image-cache
(list
(pdf-cache--make-image 2 1 "2" nil)
(pdf-cache--make-image 1 1 "1" nil)
(pdf-cache--make-image 3 1 "3" nil))))
(should-not (pdf-cache-get-image 4 1))))
|