aboutsummaryrefslogtreecommitdiffstats
path: root/test/src
diff options
context:
space:
mode:
authorAndrea Corallo2020-04-06 18:06:29 +0100
committerAndrea Corallo2020-04-06 18:06:29 +0100
commit4abb8c822ce02cf33712bd2699c5b77a5db49e31 (patch)
tree7520e3cae0f9a958ae223161034ebee6b5aa9e63 /test/src
parent32a079aef290fdc8913c1ce4e8910e63e6ff6dcc (diff)
parent3dc2f50e5bf9f58aee23fd6c61c02fadc240a377 (diff)
downloademacs-4abb8c822ce02cf33712bd2699c5b77a5db49e31.tar.gz
emacs-4abb8c822ce02cf33712bd2699c5b77a5db49e31.zip
Merge remote-tracking branch 'savannah/master' into HEAD
Diffstat (limited to 'test/src')
-rw-r--r--test/src/coding-tests.el19
1 files changed, 19 insertions, 0 deletions
diff --git a/test/src/coding-tests.el b/test/src/coding-tests.el
index 094a1fad8fa..93e6709d442 100644
--- a/test/src/coding-tests.el
+++ b/test/src/coding-tests.el
@@ -375,6 +375,25 @@
375 (with-temp-buffer (insert-file-contents (car file)))))) 375 (with-temp-buffer (insert-file-contents (car file))))))
376 (insert (format "%s: %s\n" (car file) result))))))) 376 (insert (format "%s: %s\n" (car file) result)))))))
377 377
378(ert-deftest coding-nocopy-trivial ()
379 "Check that the NOCOPY parameter works for the trivial coding system."
380 (let ((s "abc"))
381 (should-not (eq (decode-coding-string s nil nil) s))
382 (should (eq (decode-coding-string s nil t) s))
383 (should-not (eq (encode-coding-string s nil nil) s))
384 (should (eq (encode-coding-string s nil t) s))))
385
386(ert-deftest coding-nocopy-ascii ()
387 "Check that the NOCOPY parameter works for ASCII-only strings."
388 (let* ((uni (apply #'string (number-sequence 0 127)))
389 (multi (string-to-multibyte uni)))
390 (dolist (s (list uni multi))
391 (dolist (coding '(us-ascii iso-latin-1 utf-8))
392 (should-not (eq (decode-coding-string s coding nil) s))
393 (should-not (eq (encode-coding-string s coding nil) s))
394 (should (eq (decode-coding-string s coding t) s))
395 (should (eq (encode-coding-string s coding t) s))))))
396
378;; Local Variables: 397;; Local Variables:
379;; byte-compile-warnings: (not obsolete) 398;; byte-compile-warnings: (not obsolete)
380;; End: 399;; End: