shithub: sl

Download patch

ref: 21733d5e5d65afc738084fdb6165480ecd2ab14c
parent: 5209a8864aa07897b5d3c7cf07e238f318337932
author: Sigrid Solveig Haflínudóttir <sigrid@ftrv.se>
date: Tue Jan 28 20:46:30 EST 2025

tests: char-{up,down}case, char-{upper,lower}-case?

--- a/test/unittest.lsp
+++ b/test/unittest.lsp
@@ -525,5 +525,27 @@
 (assert (equal? #\nul (string-char s 6)))
 (assert-fail (string-char s 11))
 
+(assert (equal? #\W (char-upcase #\w)))
+(assert (equal? #\П (char-upcase #\п)))
+(assert (equal? #\nul (char-upcase #\nul)))
+
+(assert (equal? #t (char-upper-case? #\W)))
+(assert (equal? #t (char-upper-case? #\П)))
+(assert (equal? #f (char-upper-case? #\nul)))
+(assert (equal? #f (char-upper-case? #\w)))
+(assert (equal? #f (char-upper-case? #\п)))
+(assert (equal? #f (char-upper-case? #\nul)))
+
+(assert (equal? #\w (char-downcase #\W)))
+(assert (equal? #\п (char-downcase #\П)))
+(assert (equal? #\nul (char-downcase #\nul)))
+
+(assert (equal? #t (char-lower-case? #\w)))
+(assert (equal? #t (char-lower-case? #\п)))
+(assert (equal? #f (char-lower-case? #\nul)))
+(assert (equal? #f (char-lower-case? #\W)))
+(assert (equal? #f (char-lower-case? #\П)))
+(assert (equal? #f (char-lower-case? #\nul)))
+
 (princ "all tests pass")
 (newline)