mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 03:05:28 -05:00
Added tests for CCChar predicates.
This commit is contained in:
parent
b95e2de65b
commit
1486cbf5a1
1 changed files with 40 additions and 0 deletions
|
|
@ -8,3 +8,43 @@ eq None (of_int 257);;
|
||||||
q
|
q
|
||||||
(Q.string_of_size (Q.Gen.return 1))
|
(Q.string_of_size (Q.Gen.return 1))
|
||||||
(fun s -> Stdlib.( = ) (to_string s.[0]) s)
|
(fun s -> Stdlib.( = ) (to_string s.[0]) s)
|
||||||
|
;;
|
||||||
|
|
||||||
|
q (Q.int_range 65 90 |> Q.map Char.chr) CCChar.is_uppercase_ascii;;
|
||||||
|
|
||||||
|
q
|
||||||
|
(Q.int_range 0 64 |> Q.map Char.chr)
|
||||||
|
(fun c -> not @@ CCChar.is_uppercase_ascii c)
|
||||||
|
;;
|
||||||
|
|
||||||
|
q
|
||||||
|
(Q.int_range 91 127 |> Q.map Char.chr)
|
||||||
|
(fun c -> not @@ CCChar.is_uppercase_ascii c)
|
||||||
|
;;
|
||||||
|
|
||||||
|
q (Q.int_range 97 122 |> Q.map Char.chr) CCChar.is_lowercase_ascii;;
|
||||||
|
|
||||||
|
q
|
||||||
|
(Q.int_range 0 96 |> Q.map Char.chr)
|
||||||
|
(fun c -> not @@ CCChar.is_lowercase_ascii c)
|
||||||
|
;;
|
||||||
|
|
||||||
|
q
|
||||||
|
(Q.int_range 123 127 |> Q.map Char.chr)
|
||||||
|
(fun c -> not @@ CCChar.is_lowercase_ascii c)
|
||||||
|
;;
|
||||||
|
|
||||||
|
q (Q.int_range 48 57 |> Q.map Char.chr) CCChar.is_digit_ascii;;
|
||||||
|
q (Q.int_range 0 47 |> Q.map Char.chr) (fun c -> not @@ CCChar.is_digit_ascii c)
|
||||||
|
;;
|
||||||
|
|
||||||
|
q
|
||||||
|
(Q.int_range 58 127 |> Q.map Char.chr)
|
||||||
|
(fun c -> not @@ CCChar.is_digit_ascii c)
|
||||||
|
;;
|
||||||
|
|
||||||
|
eq true (String.for_all CCChar.is_whitespace_ascii "\n\t \010\011\012\013");;
|
||||||
|
|
||||||
|
eq false
|
||||||
|
(String.for_all CCChar.is_whitespace_ascii
|
||||||
|
"Hello!--NOthina\055kag$$$%^bch\008h")
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue