summaryrefslogtreecommitdiff
path: root/test/src/fileio-tests.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2019-07-09 17:04:07 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2019-07-09 17:04:24 -0400
commitfec111c9ee7a248ac49ba1d6d62d3ef9473b7af9 (patch)
treec88f33a33fbd4bba52c7b0e8310dcdfc99591065 /test/src/fileio-tests.el
parent4c619758b2806ee6607af7b1d56943e547001e7a (diff)
downloademacs-fec111c9ee7a248ac49ba1d6d62d3ef9473b7af9.tar.gz
* 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/fileio-tests.el')
-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."
(let ((set-auto-coding-function (lambda (&rest _) (throw 'toto nil))))
(insert-file-contents f)))
(goto-char (point-min))
- (forward-line 1)
- (let ((c1 (char-after)))
- (forward-char 1)
- (should (equal c1 (char-before)))
- (should (equal c1 (char-after))))))
+ (unless (eobp)
+ (forward-line 1)
+ (let ((c1 (char-after)))
+ (forward-char 1)
+ (should (equal c1 (char-before)))
+ (should (equal c1 (char-after)))))))
(if f (delete-file f)))))
(ert-deftest fileio-tests--relative-default-directory ()