diff options
Diffstat (limited to 'test/src')
| -rw-r--r-- | test/src/fileio-tests.el | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/src/fileio-tests.el b/test/src/fileio-tests.el index 6262d946df1..bd827e5498f 100644 --- a/test/src/fileio-tests.el +++ b/test/src/fileio-tests.el | |||
| @@ -107,3 +107,22 @@ Also check that an encoding error can appear in a symlink." | |||
| 107 | (setenv "HOME" "x:foo") | 107 | (setenv "HOME" "x:foo") |
| 108 | (should (equal (expand-file-name "~/bar") "x:/foo/bar"))) | 108 | (should (equal (expand-file-name "~/bar") "x:/foo/bar"))) |
| 109 | (setenv "HOME" old-home))) | 109 | (setenv "HOME" old-home))) |
| 110 | |||
| 111 | (ert-deftest fileio-tests--insert-file-interrupt () | ||
| 112 | (let ((text "-*- coding: binary -*-\n\xc3\xc3help") | ||
| 113 | f) | ||
| 114 | (unwind-protect | ||
| 115 | (progn | ||
| 116 | (setq f (make-temp-file "ftifi")) | ||
| 117 | (write-region text nil f nil 'silent) | ||
| 118 | (with-temp-buffer | ||
| 119 | (catch 'toto | ||
| 120 | (let ((set-auto-coding-function (lambda (&rest _) (throw 'toto nil)))) | ||
| 121 | (insert-file-contents f))) | ||
| 122 | (goto-char (point-min)) | ||
| 123 | (forward-line 1) | ||
| 124 | (let ((c1 (char-after))) | ||
| 125 | (forward-char 1) | ||
| 126 | (should (equal c1 (char-before))) | ||
| 127 | (should (equal c1 (char-after)))))) | ||
| 128 | (if f (delete-file f))))) | ||