Raymond Toy pushed to branch issue-323-cl-string-casing at cmucl / cmucl
Commits:
-
c9c599f7
by Raymond Toy at 2024-06-03T08:44:43-07:00
-
e2e20bc2
by Raymond Toy at 2024-06-03T08:45:16-07:00
2 changed files:
Changes:
| ... | ... | @@ -105,7 +105,7 @@ |
| 105 | 105 | (string-upcase-simple string :start start :end end)
|
| 106 | 106 | (string-upcase-full string :start start :end end)))
|
| 107 | 107 | |
| 108 | -(defun string-downcase-simpl (string &key (start 0) end)
|
|
| 108 | +(defun string-downcase-simple (string &key (start 0) end)
|
|
| 109 | 109 | _N"Given a string, returns a new string that is a copy of it with all
|
| 110 | 110 | upper case alphabetic characters converted to lowercase."
|
| 111 | 111 | (declare (fixnum start))
|
| ... | ... | @@ -192,3 +192,19 @@ |
| 192 | 192 | computed-breaks)))
|
| 193 | 193 | (assert-equalp b
|
| 194 | 194 | (do-test s)))))))))
|
| 195 | + |
|
| 196 | +(define-test unicode.case-extend
|
|
| 197 | + "Test that Unicode never produces an upper or lower case character
|
|
| 198 | + outside the BMP for a character in the BMP"
|
|
| 199 | + (:tag :unicode)
|
|
| 200 | + ;; For each character code (that isn't a surrogate), find the
|
|
| 201 | + ;; corresponding Unicode upper and lowe case character. Verify that
|
|
| 202 | + ;; this character is in the BMP.
|
|
| 203 | + (loop for code from 0 below char-code-limit
|
|
| 204 | + unless (lisp::surrogatep code)
|
|
| 205 | + do
|
|
| 206 | + (assert-true (< (lisp::unicode-upper code) char-code-limit)
|
|
| 207 | + code (lisp::unicode-upper code))
|
|
| 208 | + (assert-true (< (lisp::unicode-lower code) char-code-limit)
|
|
| 209 | + code (lisp::unicode-upper code))))
|
|
| 210 | + |