From bace9fe20940d8afeea12f7660db2e16ece7b3f7 Mon Sep 17 00:00:00 2001 From: Alexander Date: Sat, 4 Jan 2025 10:11:03 -0500 Subject: [PATCH] Fixed tests to work with older OCaml versions that lack `String.for_all`. --- tests/core/t_char.ml | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/tests/core/t_char.ml b/tests/core/t_char.ml index 7c7691fe..665f4f3f 100644 --- a/tests/core/t_char.ml +++ b/tests/core/t_char.ml @@ -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.exists 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'; + ])