aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorNoam Postavsky2019-04-28 16:29:44 -0400
committerNoam Postavsky2019-04-28 16:45:13 -0400
commit74712470fcb95cd4ef6ef5c61eee73cb8e02a8bd (patch)
tree3c802c616119719cf8434e77706fd22915df0a8c /test
parentcaadbd94921b66fd6820dbc95783765837b931f7 (diff)
downloademacs-74712470fcb95cd4ef6ef5c61eee73cb8e02a8bd.tar.gz
emacs-74712470fcb95cd4ef6ef5c61eee73cb8e02a8bd.zip
Replace use of obsolete string-make-unibyte
* lisp/image-file.el (insert-image-file): Use encode-coding-region instead of string-make-unibyte. * test/lisp/image-file-tests.el: New test.
Diffstat (limited to 'test')
-rw-r--r--test/lisp/image-file-tests.el44
1 files changed, 44 insertions, 0 deletions
diff --git a/test/lisp/image-file-tests.el b/test/lisp/image-file-tests.el
new file mode 100644
index 00000000000..b3676d1f02c
--- /dev/null
+++ b/test/lisp/image-file-tests.el
@@ -0,0 +1,44 @@
1;;; image-file-tests.el --- Test suite for image-files -*- lexical-binding: t; -*-
2
3;; Copyright (C) 2019 Free Software Foundation, Inc.
4
5;; This file is part of GNU Emacs.
6
7;; GNU Emacs is free software: you can redistribute it and/or modify
8;; it under the terms of the GNU General Public License as published by
9;; the Free Software Foundation, either version 3 of the License, or
10;; (at your option) any later version.
11
12;; GNU Emacs is distributed in the hope that it will be useful,
13;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15;; GNU General Public License for more details.
16
17;; You should have received a copy of the GNU General Public License
18;; along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
19
20;;; Commentary:
21
22;;; Code:
23
24(require 'ert)
25(require 'image-file)
26
27(defconst image-file-tests-data-directory
28 (expand-file-name "data/image" (getenv "EMACS_TEST_DIRECTORY"))
29 "Directory containing image test data.")
30
31(ert-deftest insert-image-file ()
32 (skip-unless (image-type-available-p 'png))
33 (with-temp-buffer
34 (set-buffer-multibyte t)
35 (insert-image-file (expand-file-name "blank-100x200.png"
36 image-file-tests-data-directory))
37 (should (image--get-image)))
38 (with-temp-buffer
39 (set-buffer-multibyte nil)
40 (insert-image-file (expand-file-name "blank-100x200.png"
41 image-file-tests-data-directory))
42 (should (image--get-image))))
43
44;;; image-file-tests.el ends here