]> code.delx.au - gnu-emacs/blobdiff - test/automated/files.el
* test/automated/package-test.el (package-test-signed): Tweak skip
[gnu-emacs] / test / automated / files.el
index 6ce1cbc24575a94de8beaa38657d9436700a008e..3c6f61b792cbca5213c08d252cf79638b9191ea5 100644 (file)
@@ -1,6 +1,6 @@
 ;;; files.el --- tests for file handling.
 
-;; Copyright (C) 2012-2013 Free Software Foundation, Inc.
+;; Copyright (C) 2012-2016 Free Software Foundation, Inc.
 
 ;; This file is part of GNU Emacs.
 
@@ -148,6 +148,24 @@ form.")
              (should (file-test--do-local-variables-test str subtest))))))
     (ad-disable-advice 'hack-local-variables-confirm 'around 'files-test)))
 
+(defvar files-test-bug-18141-file
+  (expand-file-name "data/files-bug18141.el.gz" (getenv "EMACS_TEST_DIRECTORY"))
+  "Test file for bug#18141.")
+
+(ert-deftest files-test-bug-18141 ()
+  "Test for http://debbugs.gnu.org/18141 ."
+  (skip-unless (executable-find "gzip"))
+  (let ((tempfile (make-temp-file "files-test-bug-18141" nil ".gz")))
+    (unwind-protect
+       (progn
+         (copy-file files-test-bug-18141-file tempfile t)
+         (with-current-buffer (find-file-noselect tempfile)
+           (set-buffer-modified-p t)
+           (save-buffer)
+           (should (eq buffer-file-coding-system 'iso-2022-7bit-unix))))
+      (delete-file tempfile))))
+
+
 ;; Stop the above "Local Var..." confusing Emacs.
 \f