aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorStefan Monnier2019-07-09 17:04:07 -0400
committerStefan Monnier2019-07-09 17:04:24 -0400
commitfec111c9ee7a248ac49ba1d6d62d3ef9473b7af9 (patch)
treec88f33a33fbd4bba52c7b0e8310dcdfc99591065 /test/src
parent4c619758b2806ee6607af7b1d56943e547001e7a (diff)
downloademacs-fec111c9ee7a248ac49ba1d6d62d3ef9473b7af9.tar.gz
emacs-fec111c9ee7a248ac49ba1d6d62d3ef9473b7af9.zip
* src/fileio.c: Fix bug#36431
(decide_coding_unwind): Re-introduce. Move text back to the gap. Return the new `inserted` via the unwind_data. (Finsert_file_contents): Use it. Make sure `inserted` is always 0 when we jump straight to `notfound`. Don't insert the text in the buffer until we know it's properly decoded for the byteness of the buffer. * test/src/fileio-tests.el (fileio-tests--insert-file-interrupt): Allow insert-file-contents to return an empty buffer in case of non-local exit in set-auto-coding-function.
Diffstat (limited to 'test/src')
-rw-r--r--test/src/fileio-tests.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/test/src/fileio-tests.el b/test/src/fileio-tests.el
index 8788c830c94..0e0230a145d 100644
--- a/test/src/fileio-tests.el
+++ b/test/src/fileio-tests.el
@@ -120,11 +120,12 @@ Also check that an encoding error can appear in a symlink."
120 (let ((set-auto-coding-function (lambda (&rest _) (throw 'toto nil)))) 120 (let ((set-auto-coding-function (lambda (&rest _) (throw 'toto nil))))
121 (insert-file-contents f))) 121 (insert-file-contents f)))
122 (goto-char (point-min)) 122 (goto-char (point-min))
123 (forward-line 1) 123 (unless (eobp)
124 (let ((c1 (char-after))) 124 (forward-line 1)
125 (forward-char 1) 125 (let ((c1 (char-after)))
126 (should (equal c1 (char-before))) 126 (forward-char 1)
127 (should (equal c1 (char-after)))))) 127 (should (equal c1 (char-before)))
128 (should (equal c1 (char-after)))))))
128 (if f (delete-file f))))) 129 (if f (delete-file f)))))
129 130
130(ert-deftest fileio-tests--relative-default-directory () 131(ert-deftest fileio-tests--relative-default-directory ()