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

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

From
jian he
Date:

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".

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

From
Tom Lane
Date:
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