@@ -8,6 +8,27 @@ let test_basic_matching _ =
88 assert_equal " matched hello" (match_hello " hello" );
99 assert_equal " no match" (match_hello " world" );
1010
11+ let match_lower = function % mikmatch {| lower |} -> " lower" | _ -> " not lower" in
12+ assert_equal " lower" (match_lower " a" );
13+ assert_equal " not lower" (match_lower " A" );
14+ assert_equal " not lower" (match_lower " \xb5 " );
15+
16+ let match_cntrl = function % mikmatch {| cntrl |} -> " control character" | _ -> " not a control character" in
17+ assert_equal " control character" (match_cntrl " \x00 " );
18+ assert_equal " control character" (match_cntrl " \x01 " );
19+ assert_equal " control character" (match_cntrl " \t " );
20+ assert_equal " control character" (match_cntrl " \n " );
21+ assert_equal " control character" (match_cntrl " \x1f " );
22+ assert_equal " control character" (match_cntrl " \x7f " );
23+ assert_equal " not a control character" (match_cntrl " " );
24+ assert_equal " not a control character" (match_cntrl " \x00\x00 " );
25+ assert_equal " not a control character" (match_cntrl " " );
26+ assert_equal " not a control character" (match_cntrl " ~" );
27+ assert_equal " not a control character" (match_cntrl " \x80 " );
28+ assert_equal " not a control character" (match_cntrl " \x81 " );
29+ assert_equal " not a control character" (match_cntrl " \x9f " );
30+ assert_equal " not a control character" (match_cntrl " \xff " );
31+
1132 let match_digit = function % mikmatch {| digit |} -> " single digit" | _ -> " not a digit" in
1233 assert_equal " single digit" (match_digit " 5" );
1334 assert_equal " not a digit" (match_digit " a" );
@@ -422,7 +443,7 @@ let test_mixed_matching _ =
422443
423444 assert_equal " got a" (no_default_case " a" );
424445 assert_equal " got b" (no_default_case " b" );
425- assert_raises (Failure " File tests/test_ppx_mikmatch.ml, lines 417-419 , characters 24-33: String did not match any mikmatch cases." )
446+ assert_raises (Failure " File tests/test_ppx_mikmatch.ml, lines 438-440 , characters 24-33: String did not match any mikmatch cases." )
426447 (fun () -> no_default_case " c" )
427448
428449type mode =
0 commit comments