Lines Matching refs:test
255 do_one_test (const struct test_s *test, const char *fail) in do_one_test() argument
261 re_set_syntax (test->syntax); in do_one_test()
263 err = re_compile_pattern (test->pattern, strlen (test->pattern), in do_one_test()
267 printf ("%sre_compile_pattern \"%s\" failed: %s\n", fail, test->pattern, in do_one_test()
278 res = re_search (®buf, test->string, strlen (test->string), in do_one_test()
279 test->start, strlen (test->string) - test->start, NULL); in do_one_test()
283 if (res != test->res) in do_one_test()
286 fail, test->pattern, test->string, res, test->res); in do_one_test()
291 if (test->res > 0 && test->start == 0) in do_one_test()
299 res = re_search (®buf, test->string, strlen (test->string), in do_one_test()
300 test->res, strlen (test->string) - test->res, NULL); in do_one_test()
304 if (res != test->res) in do_one_test()
307 fail, test->pattern, test->string, res, test->res); in do_one_test()
342 do_mb_tests (const struct test_s *test) in do_mb_tests() argument
348 char pattern[strlen (test->pattern) * 4 + 1]; in do_mb_tests()
349 char string[strlen (test->string) * 4 + 1]; in do_mb_tests()
352 t = *test; in do_mb_tests()
362 if (!strchr (test->pattern, chars[j]) in do_mb_tests()
363 && !strchr (test->string, chars[j])) in do_mb_tests()
371 for (j = 0, p = pattern; test->pattern[j]; ++j) in do_mb_tests()
372 if (strchr (repl, test->pattern[j])) in do_mb_tests()
373 p = replace (p, test->pattern[j]); in do_mb_tests()
374 else if (test->pattern[j] == '\\' && test->pattern[j + 1]) in do_mb_tests()
376 *p++ = test->pattern[j++]; in do_mb_tests()
377 *p++ = test->pattern[j]; in do_mb_tests()
380 *p++ = test->pattern[j]; in do_mb_tests()
383 t.start = test->start; in do_mb_tests()
384 t.res = test->res; in do_mb_tests()
386 for (j = 0, p = string; test->string[j]; ++j) in do_mb_tests()
387 if (strchr (repl, test->string[j])) in do_mb_tests()
389 char *d = replace (p, test->string[j]); in do_mb_tests()
390 if (test->start > j) in do_mb_tests()
392 if (test->res > j) in do_mb_tests()
397 *p++ = test->string[j]; in do_mb_tests()