aboutsummaryrefslogtreecommitdiffstats
path: root/test/src/coding-tests.el
diff options
context:
space:
mode:
authorYuan Fu2022-08-29 11:41:10 -0700
committerYuan Fu2022-08-29 11:41:10 -0700
commit77d5a0cf9fc4a6dc44f0c6ee5e3295e0eea08273 (patch)
tree969937ec44ce5ddf9447b074aa15314e0b9e8e95 /test/src/coding-tests.el
parente98b4715bb986524bde9356b62429af9786ae716 (diff)
parentdf2f6fb7fc4b79834ae40db8be2ccdc1e4a273f1 (diff)
downloademacs-77d5a0cf9fc4a6dc44f0c6ee5e3295e0eea08273.tar.gz
emacs-77d5a0cf9fc4a6dc44f0c6ee5e3295e0eea08273.zip
Merge remote-tracking branch 'origin/master' into feature/tree-sitter
Diffstat (limited to 'test/src/coding-tests.el')
-rw-r--r--test/src/coding-tests.el25
1 files changed, 11 insertions, 14 deletions
diff --git a/test/src/coding-tests.el b/test/src/coding-tests.el
index de4ddb546df..f65d575d0c2 100644
--- a/test/src/coding-tests.el
+++ b/test/src/coding-tests.el
@@ -61,16 +61,17 @@
61;; Return the contents (specified by CONTENT-TYPE; ascii, latin, or 61;; Return the contents (specified by CONTENT-TYPE; ascii, latin, or
62;; binary) of a test file. 62;; binary) of a test file.
63(defun coding-tests-file-contents (content-type) 63(defun coding-tests-file-contents (content-type)
64 (let* ((ascii "ABCDEFGHIJKLMNOPQRSTUVWXYZ\n") 64 (with-suppressed-warnings ((obsolete string-as-unibyte))
65 (latin (concat ascii "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ\n")) 65 (let* ((ascii "ABCDEFGHIJKLMNOPQRSTUVWXYZ\n")
66 (binary (string-to-multibyte 66 (latin (concat ascii "ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏ\n"))
67 (concat (string-as-unibyte latin) 67 (binary (string-to-multibyte
68 (unibyte-string #xC0 #xC1 ?\n))))) 68 (concat (string-as-unibyte latin)
69 (cond ((eq content-type 'ascii) ascii) 69 (unibyte-string #xC0 #xC1 ?\n)))))
70 ((eq content-type 'latin) latin) 70 (cond ((eq content-type 'ascii) ascii)
71 ((eq content-type 'binary) binary) 71 ((eq content-type 'latin) latin)
72 (t 72 ((eq content-type 'binary) binary)
73 (error "Invalid file content type: %s" content-type))))) 73 (t
74 (error "Invalid file content type: %s" content-type))))))
74 75
75;; Generate FILE with CONTENTS encoded by CODING-SYSTEM. 76;; Generate FILE with CONTENTS encoded by CODING-SYSTEM.
76;; whose encoding specified by CODING-SYSTEM. 77;; whose encoding specified by CODING-SYSTEM.
@@ -429,9 +430,5 @@
429 '((iso-latin-1 3) (us-ascii 1 3)))) 430 '((iso-latin-1 3) (us-ascii 1 3))))
430 (should-error (check-coding-systems-region "å" nil '(bad-coding-system)))) 431 (should-error (check-coding-systems-region "å" nil '(bad-coding-system))))
431 432
432;; Local Variables:
433;; byte-compile-warnings: (not obsolete)
434;; End:
435
436(provide 'coding-tests) 433(provide 'coding-tests)
437;;; coding-tests.el ends here 434;;; coding-tests.el ends here