Improved support for Unicode title case in Guile's string and character APIs.
[bpt/guile.git] / test-suite / tests / srfi-13.test
index d8e3799..6864287 100644 (file)
 
 (with-test-prefix "string-any"
 
+  (pass-if "null string"
+    (not (string-any #\a "")))
+
+  (pass-if "start index == end index"
+    (not (string-any #\a "aaa" 1 1)))
+
   (with-test-prefix "bad char_pred"
 
     (pass-if-exception "integer" exception:wrong-type-arg
     (pass-if "more than one match, start and end index"
       (string-any char-upper-case? "abCDE" 1 4))))
 
+;;;
+;;; string-titlecase
+;;;
+
+(with-test-prefix "string-titlecase"
+
+  (pass-if "all-lower" 
+    (string=? "Foo" (string-titlecase "foo")))
+
+  (pass-if "all-upper"
+    (string=? "Foo" (string-titlecase "FOO")))
+
+  (pass-if "two-words"
+    (string=? "Hello, World!" (string-titlecase "hello, world!")))
+
+  (pass-if "titlecase-characters"
+    (string=? (list->string '(#\762)) 
+             (string-titlecase (list->string '(#\763))))))
+
 ;;;
 ;;; string-append/shared
 ;;;
 
 (with-test-prefix "string-every"
 
+  (pass-if "null string"
+    (string-every #\a ""))
+
+  (pass-if "start index == end index"
+    (string-every #\a "bbb" 1 1))
+
   (with-test-prefix "bad char_pred"
 
     (pass-if-exception "integer" exception:wrong-type-arg