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 Add test that a BMP character has an upper/lower case in the BMP.
- - - - - e2e20bc2 by Raymond Toy at 2024-06-03T08:45:16-07:00 Fix typo in name of string-downcase-simpl
It should be `string-downcase-simple`.
- - - - -
2 changed files:
- src/code/unicode.lisp - tests/unicode.lisp
Changes:
===================================== src/code/unicode.lisp ===================================== @@ -105,7 +105,7 @@ (string-upcase-simple string :start start :end end) (string-upcase-full string :start start :end end)))
-(defun string-downcase-simpl (string &key (start 0) end) +(defun string-downcase-simple (string &key (start 0) end) _N"Given a string, returns a new string that is a copy of it with all upper case alphabetic characters converted to lowercase." (declare (fixnum start))
===================================== tests/unicode.lisp ===================================== @@ -192,3 +192,19 @@ computed-breaks))) (assert-equalp b (do-test s))))))))) + +(define-test unicode.case-extend + "Test that Unicode never produces an upper or lower case character + outside the BMP for a character in the BMP" + (:tag :unicode) + ;; For each character code (that isn't a surrogate), find the + ;; corresponding Unicode upper and lowe case character. Verify that + ;; this character is in the BMP. + (loop for code from 0 below char-code-limit + unless (lisp::surrogatep code) + do + (assert-true (< (lisp::unicode-upper code) char-code-limit) + code (lisp::unicode-upper code)) + (assert-true (< (lisp::unicode-lower code) char-code-limit) + code (lisp::unicode-upper code)))) +
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/-/compare/e6ef0eacc569fbad7f87a53...