mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 11:15:31 -05:00
Fixed tests to work with older OCaml versions that lack String.for_all.
This commit is contained in:
parent
1486cbf5a1
commit
bace9fe209
1 changed files with 36 additions and 3 deletions
|
|
@ -43,8 +43,41 @@ q
|
||||||
(fun c -> not @@ CCChar.is_digit_ascii c)
|
(fun c -> not @@ CCChar.is_digit_ascii c)
|
||||||
;;
|
;;
|
||||||
|
|
||||||
eq true (String.for_all CCChar.is_whitespace_ascii "\n\t \010\011\012\013");;
|
eq true
|
||||||
|
(Stdlib.List.for_all CCChar.is_whitespace_ascii
|
||||||
|
[ '\n'; '\t'; ' '; '\010'; '\011'; '\012'; '\013' ])
|
||||||
|
;;
|
||||||
|
|
||||||
eq false
|
eq false
|
||||||
(String.for_all CCChar.is_whitespace_ascii
|
(Stdlib.List.exists CCChar.is_whitespace_ascii
|
||||||
"Hello!--NOthina\055kag$$$%^bch\008h")
|
[
|
||||||
|
'H';
|
||||||
|
'e';
|
||||||
|
'l';
|
||||||
|
'l';
|
||||||
|
'o';
|
||||||
|
'!';
|
||||||
|
'-';
|
||||||
|
'-';
|
||||||
|
'N';
|
||||||
|
'O';
|
||||||
|
't';
|
||||||
|
'h';
|
||||||
|
'i';
|
||||||
|
'n';
|
||||||
|
'a';
|
||||||
|
'\055';
|
||||||
|
'k';
|
||||||
|
'a';
|
||||||
|
'g';
|
||||||
|
'$';
|
||||||
|
'$';
|
||||||
|
'$';
|
||||||
|
'%';
|
||||||
|
'^';
|
||||||
|
'b';
|
||||||
|
'c';
|
||||||
|
'h';
|
||||||
|
'\008';
|
||||||
|
'h';
|
||||||
|
])
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue