src/test/modules/test_regex/test_regex.c typo issue

Started by jian heabout 3 years ago2 messageshackers
Jump to latest
#1jian he
jian.universality@gmail.com

Hi,
in src/test/modules/test_regex/test_regex.c

/* Report individual info bit states */
for (inf = infonames; inf->bit != 0; inf++)
{
if (cpattern->re_info & inf->bit)
{
if (flags->info & inf->bit)
elems[nresults++] = PointerGetDatum(cstring_to_text(inf->text));
else
{
snprintf(buf, sizeof(buf), "unexpected %s!", inf->text);
elems[nresults++] = PointerGetDatum(cstring_to_text(buf));
}
}
else
{
if (flags->info & inf->bit)
{
snprintf(buf, sizeof(buf), "missing %s!", inf->text);
elems[nresults++] = PointerGetDatum(cstring_to_text(buf));
}
}
}

I think "expected" should be replaced with "missing".
the "missing" should be replaced with "expected".

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: jian he (#1)
Re: src/test/modules/test_regex/test_regex.c typo issue

jian he <jian.universality@gmail.com> writes:

in src/test/modules/test_regex/test_regex.c
...
I think "expected" should be replaced with "missing".
the "missing" should be replaced with "expected".

It looks correct to me as-is. cpattern->re_info is the
data-under-test, flags->info is the presumed-correct
reference data.

regards, tom lane