File: old_pcre2_tests.ml

package info (click to toggle)
pcre2-ocaml 8.0.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 356 kB
  • sloc: ml: 2,435; ansic: 562; makefile: 34
file content (24 lines) | stat: -rw-r--r-- 549 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
open OUnit2
open Pcre2

let simple_test ctxt =
  assert_equal 0 0;
  assert_equal
    [ Text "ab"; Delim "x"; Group (1, "x"); NoGroup; Text "cd" ]
    (full_split ~pat:"(x)|(u)" "abxcd");
  assert_equal
    [
      Text "ab";
      Delim "x";
      Group (1, "x");
      NoGroup;
      Text "cd";
      Delim "u";
      NoGroup;
      Group (2, "u");
      Text "ef";
    ]
    (full_split ~pat:"(x)|(u)" "abxcduef")

let suite = "Test pcre" >::: [ "simple_test" >:: simple_test ]
let _ = if not !Sys.interactive then run_test_tt_main suite else ()