]> git.eshelyaron.com Git - emacs.git/commitdiff
* test/lisp/net/tramp-tests.el (tramp-test10-write-region): Extend test.
authorMichael Albinus <michael.albinus@gmx.de>
Sun, 6 Aug 2023 12:30:57 +0000 (14:30 +0200)
committerMichael Albinus <michael.albinus@gmx.de>
Sun, 6 Aug 2023 12:30:57 +0000 (14:30 +0200)
test/lisp/net/tramp-tests.el

index 00e368abe4dfc800be5bf57b1be9211c0293d89d..f4938cf9a01a37519fc26356c12ed28c317e92b0 100644 (file)
@@ -2676,7 +2676,18 @@ This checks also `file-name-as-directory', `file-name-directory',
              :type 'file-already-exists)
            (should-error
             (write-region "foo" nil tmp-name nil nil nil 'excl)
-            :type 'file-already-exists))
+            :type 'file-already-exists)
+           (delete-file tmp-name)
+
+           ;; Check `buffer-file-coding-system'.  Bug#65022.
+           (with-temp-buffer
+             (setq buffer-file-name tmp-name)
+             (insert "foo")
+             (set-buffer-file-coding-system 'cp1251)
+             (let ((bfcs buffer-file-coding-system))
+               (should (buffer-modified-p))
+               (should (null (save-buffer)))
+               (should (eq buffer-file-coding-system bfcs)))))
 
        ;; Cleanup.
        (ignore-errors (delete-file tmp-name))))))