summaryrefslogtreecommitdiff
path: root/test/src/fileio-tests.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2022-06-11 14:39:54 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2022-06-11 14:39:54 +0200
commitcb4579ed6ba45c81ee7ec627bf197e1def121f24 (patch)
tree1876c474349aad31d42f06587f68510ed8988ad2 /test/src/fileio-tests.el
parent36758096961930baaf0e271522abfb78ff7f656d (diff)
downloademacs-cb4579ed6ba45c81ee7ec627bf197e1def121f24.tar.gz
Allow inserting parts of /dev/urandom with insert-file-contents
* doc/lispref/files.texi (Reading from Files): Document it. * src/fileio.c (Finsert_file_contents): Allow specifying END for special files (bug#18370).
Diffstat (limited to 'test/src/fileio-tests.el')
-rw-r--r--test/src/fileio-tests.el7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/src/fileio-tests.el b/test/src/fileio-tests.el
index 511490c5745..a9a43781d49 100644
--- a/test/src/fileio-tests.el
+++ b/test/src/fileio-tests.el
@@ -193,4 +193,11 @@ Also check that an encoding error can appear in a symlink."
(should (equal (file-name-concat "" "bar") "bar"))
(should (equal (file-name-concat "" "") "")))
+(defun test-non-regular-insert ()
+ (skip-unless (file-exists-p "/dev/urandom"))
+ (with-temp-buffer
+ (should-error (insert-file-contents "/dev/urandom" nil 5 10))
+ (insert-file-contents "/dev/urandom" nil nil 10)
+ (should (= (point-max) 10))))
+
;;; fileio-tests.el ends here