Skip to content

Commit

Permalink
test: reproduce #213
Browse files Browse the repository at this point in the history
Re.Posix doesn't support character class

Signed-off-by: Rudi Grinberg <me@rgrinberg.com>

<!-- ps-id: e4ad97fe-6d31-411e-8a88-d1035a11592d -->
  • Loading branch information
rgrinberg committed Apr 14, 2024
1 parent 1ec9a97 commit 09f1ce1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib_test/dune
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
(tests
(libraries re fort_unit)
(modules :standard \ test_str)
(names test_easy test_re test_perl test_emacs test_glob test_pcre))
(names test_easy test_re test_perl test_emacs test_glob test_pcre test_posix))

(test
(libraries re fort_unit str)
Expand Down
13 changes: 13 additions & 0 deletions lib_test/test_posix.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
open OUnit

let test_class_space () =
match Re.Posix.compile_pat {|a[[:space:]]b|} with
| exception Re.Posix.Not_supported -> ()
| (_ : Re.re) -> assert false

let suite = "posix" >:::
[ "regression 213" >:: test_class_space
]

let () =
ignore (run_test_tt_main suite)

0 comments on commit 09f1ce1

Please sign in to comment.