Skip to content

Commit

Permalink
Fixed tests to work with older OCaml versions that lack `String.for_a…
Browse files Browse the repository at this point in the history
…ll`.
  • Loading branch information
mobotsar committed Jan 4, 2025
1 parent 1486cbf commit a48c494
Showing 1 changed file with 36 additions and 3 deletions.
39 changes: 36 additions & 3 deletions tests/core/t_char.ml
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,41 @@ q
(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
(String.for_all CCChar.is_whitespace_ascii
"Hello!--NOthina\055kag$$$%^bch\008h")
(Stdlib.List.for_all CCChar.is_whitespace_ascii
[
'H';
'e';
'l';
'l';
'o';
'!';
'-';
'-';
'N';
'O';
't';
'h';
'i';
'n';
'a';
'\055';
'k';
'a';
'g';
'$';
'$';
'$';
'%';
'^';
'b';
'c';
'h';
'\008';
'h';
])

0 comments on commit a48c494

Please sign in to comment.