comparison tests.c @ 635:d191ded8a790

Improve the experimental regex matching debugging macros.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 21 Jan 2020 07:16:18 +0200
parents afcaf5e38f56
children 9e1f9e1d1487
comparison
equal deleted inserted replaced
634:c09b068ecb32 635:d191ded8a790
879 if (test_set_start("Regular expressions")) 879 if (test_set_start("Regular expressions"))
880 { 880 {
881 th_regex_ctx *reg = NULL; 881 th_regex_ctx *reg = NULL;
882 int res; 882 int res;
883 883
884 #ifdef TH_EXPERIMENTAL_REGEX_DEBUG
885 th_dbg_re_flags = TH_DBG_RE_MATCH;
886 #endif
887
884 #if 0 888 #if 0
885 res = th_regex_compile(&reg, "z*k+abba fabboa? k{4} [gz]{1,2} foo(bar|zoo)?"); 889 res = th_regex_compile(&reg, "z*k+abba fabboa? k{4} [gz]{1,2} foo(bar|zoo)?");
886 if (res != THERR_OK) 890 if (res != THERR_OK)
887 printf("result: %s\n", th_error_str(res)); 891 printf("result: %s\n", th_error_str(res));
888 th_regex_free(reg); 892 th_regex_free(reg);
931 { 935 {
932 static const test_regex_def tlist[] = 936 static const test_regex_def tlist[] =
933 { 937 {
934 // { "zoobar" , 1, 0 }, 938 // { "zoobar" , 1, 0 },
935 { "zoo lol bar" , 1, 0 }, 939 { "zoo lol bar" , 1, 0 },
936 // { "hoho zoo lol lol bar bar" , 1, 0 }, 940 { "hoho zoo lol lol bar bar" , 1, 0 },
937 { NULL , 0, 0 } 941 { NULL , 0, 0 }
938 }; 942 };
939 943
940 test_regex_list(tlist, "zoo.*?bar"); 944 test_regex_list(tlist, "zoo.*?bar");
941 } 945 }