@@ -128,6 +128,11 @@ t_toTitle_1stNotLower = and . notLow . T.toTitle . T.filter stable . T.filter (n
128
128
-- https://en.wikipedia.org/wiki/Georgian_Extended
129
129
isGeorgian c = c >= '\ 4256 ' && c < '\ 4352 '
130
130
131
+ t_toUpper_idempotent t = T. toUpper (T. toUpper t) === T. toUpper t
132
+ t_toLower_idempotent t = T. toLower (T. toLower t) === T. toLower t
133
+ t_toTitle_idempotent t = T. toTitle (T. toTitle t) === T. toTitle t
134
+ t_toCaseFold_idempotent t = T. toCaseFold (T. toCaseFold t) === T. toCaseFold t
135
+
131
136
ascii_toLower (ASCIIString xs) = map C. toLower xs === T. unpack (T. toLower (T. pack xs))
132
137
ascii_toUpper (ASCIIString xs) = map C. toUpper xs === T. unpack (T. toUpper (T. pack xs))
133
138
ascii_toCaseFold (ASCIIString xs) = map C. toLower xs === T. unpack (T. toCaseFold (T. pack xs))
@@ -331,6 +336,10 @@ testText =
331
336
testProperty " tl_toUpper_upper" tl_toUpper_upper,
332
337
testProperty " t_toTitle_title" t_toTitle_title,
333
338
testProperty " t_toTitle_1stNotLower" t_toTitle_1stNotLower,
339
+ testProperty " t_toUpper_idempotent" t_toUpper_idempotent,
340
+ testProperty " t_toLower_idempotent" t_toLower_idempotent,
341
+ testProperty " t_toTitle_idempotent" t_toTitle_idempotent,
342
+ testProperty " t_toCaseFold_idempotent" t_toCaseFold_idempotent,
334
343
testProperty " ascii_toLower" ascii_toLower,
335
344
testProperty " ascii_toUpper" ascii_toUpper,
336
345
testProperty " ascii_toTitle" ascii_toTitle,
0 commit comments