Lines Matching refs:ans
858 matchprint(regmatch_t* match, int nmatch, int nsub, char* ans, unsigned long test)
875 if (ans)
876 printf(" expected: %s", ans);
882 matchcheck(regmatch_t* match, int nmatch, int nsub, char* ans, char* re, char* s, int len, int flags, unsigned long test)
889 if (streq(ans, "OK"))
891 for (i = 0, p = ans; i < nmatch && *p; i++)
952 matchprint(match, nmatch, nsub, ans, test);
971 matchprint(match, nmatch, nsub, ans, test);
1078 extract(int* tabs, char* spec, char* re, char* s, char* ans, char* msg, char* accept, regmatch_t* match, int nmatch, int nsub, unsigned long skip, unsigned long level, unsigned long test)
1121 printf("%s", ans);
1138 catchfree(regex_t* preg, int flags, int* tabs, char* spec, char* re, char* s, char* ans, char* msg, char* accept, regmatch_t* match, int nmatch, int nsub, unsigned long skip, unsigned long level, unsigned long test)
1154 extract(tabs, spec, re, s, ans, msg, NiL, NiL, 0, 0, skip, level, test);
1242 char* ans;
1566 if ((ans = setlocale(LC_COLLATE, s)) && streq(ans, "POSIX"))
1567 ans = "C";
1568 if (!ans || !streq(ans, s) && streq(s, "C"))
1569 ans = 0;
1570 else if ((ans = setlocale(LC_CTYPE, s)) && streq(ans, "POSIX"))
1571 ans = "C";
1572 if (!ans || !streq(ans, s) && streq(s, "C"))
1828 if (!(ans = field[(test & TEST_DECOMP) ? 2 : 3]))
1907 extract(tabs, line, re, s, ans, msg, NiL, NiL, 0, 0, skip, level, test|TEST_OK);
1962 if (catchfree(&preg, flags, tabs, line, re, s, ans, msg, NiL, NiL, 0, 0, skip, level, test))
1987 catchfree(&preg, flags, tabs, line, re, s, ans, msg, NiL, NiL, 0, 0, skip, level, test);
1990 if (i != (strlen(ans) + 1))
1996 else if (strcmp(buf, ans))
1999 quote(ans, -1, test|TEST_DELIMIT);
2010 if (!(flags & REG_NOSUB) && nsub < 0 && *ans == '(')
2012 for (p = ans; *p; p++)
2029 skip = extract(tabs, line, re, s, ans, msg, "OK", NiL, 0, 0, skip, level, test|TEST_DELIMIT);
2042 if (!(test & (TEST_DECOMP|TEST_SUB)) && *ans && *ans != '(' && !streq(ans, "OK") && !streq(ans, "NOMATCH"))
2045 skip = extract(tabs, line, re, s, ans, msg, "OK", NiL, 0, 0, skip, level, test|TEST_DELIMIT);
2049 printf("%s expected, OK returned\n", ans);
2051 catchfree(&preg, flags, tabs, line, re, s, ans, msg, NiL, NiL, 0, 0, skip, level, test);
2059 else if (!*ans || ans[0]=='(' || cret == REG_BADPAT && streq(ans, "NOMATCH"))
2066 skip = extract(tabs, line, re, s, ans, msg, codes[got].name, NiL, 0, 0, skip, level, test|TEST_DELIMIT);
2079 if (streq(ans, codes[i].name))
2087 skip = extract(tabs, line, re, s, ans, msg, codes[got].name, NiL, 0, 0, skip, level, test|TEST_DELIMIT);
2091 printf("%s expected, %s returned\n", ans, codes[got].name);
2097 skip = extract(tabs, line, re, s, ans, msg, codes[got].name, NiL, 0, 0, skip, level, test|TEST_DELIMIT);
2103 printf("%s expected, %s returned: ", ans, codes[got].name);
2160 if (eret != REG_NOMATCH || !streq(ans, "NOMATCH"))
2163 skip = extract(tabs, line, re, s, ans, msg, "NOMATCH", NiL, 0, 0, skip, level, test|TEST_DELIMIT);
2171 else if (streq(ans, "NOMATCH"))
2174 skip = extract(tabs, line, re, s, ans, msg, NiL, match, nmatch, nsub, skip, level, test|TEST_DELIMIT);
2184 if (eret != REG_NOMATCH || !streq(ans, "NOMATCH"))
2187 skip = extract(tabs, line, re, s, ans
2193 else if (*ans)
2194 printf("expected: %s\n", ans);
2200 else if (streq(ans, "NOMATCH"))
2203 skip = extract(tabs, line, re, s, ans, msg, NiL, match, nmatch, nsub, skip, level, test|TEST_DELIMIT);
2214 if (strcmp(p, ans))
2217 quote(ans, -1, test|TEST_DELIMIT);
2224 else if (!*ans)
2229 skip = extract(tabs, line, re, s, ans, msg, NiL, NiL, 0, 0, skip, level, test);
2237 else if (matchcheck(match, nmatch, nsub, ans, re, s, nstr, flags, test))
2250 if (catchfree(&preg, flags, tabs, line, re, s, ans, msg, NiL, NiL, 0, 0, skip, level, test))
2256 skip = extract(tabs, line, re, s, ans, msg, NiL, match, nmatch, nsub, skip, level, test|TEST_OK);
2259 skip = extract(tabs, line, re, s, ans, msg, NiL, match, nmatch, nsub, skip, level, test|TEST_DELIMIT);
2260 if (catchfree(&preg, flags, tabs, line, re, s, ans, msg, NiL, NiL, 0, 0, skip, level, test))