Re: change regexp_substr first argument make tests more easier to understand. - Mailing list pgsql-hackers

From jian he
Subject Re: change regexp_substr first argument make tests more easier to understand.
Date
Msg-id CACJufxFFfd057tTSEN=-Sq4K-NYVDDkkgp6EfQ+CeuyKRYAPqA@mail.gmail.com
Whole thread Raw
In response to Re: change regexp_substr first argument make tests more easier to understand.  (Tomas Vondra <tomas.vondra@enterprisedb.com>)
Responses Re: change regexp_substr first argument make tests more easier to understand.
List pgsql-hackers
On Fri, Jul 19, 2024 at 5:49 AM Tomas Vondra
<tomas.vondra@enterprisedb.com> wrote:
>
> Hi,
>
> If I understand correctly, the problem is that it's not clear which of
> the 'abc' substrings is matched/returned by the function, right?
>
> I wonder if this is a problem only for understanding the test, or if it
> makes the tests a bit weaker. I mean, what if the function returns the
> wrong substring? How would we know?
>

this is for understanding the test.
personally, sometimes, I feel the documentation is too dry, hard to follow.
so i can based on regress tests better understand the documentation.
that was my intention for the changes.


we have more sophisticated regex test at
https://git.postgresql.org/cgit/postgresql.git/tree/src/test/modules/test_regex

> Also, if we tweak this, shouldn't we tweak also the regext_instr() calls
> a bit earlier in the test script?
>
sure.
please check attached.

Attachment

pgsql-hackers by date:

Previous
From: Matthias van de Meent
Date:
Subject: Re: DRAFT: Pass sk_attno to consistent function
Next
From: Noah Misch
Date:
Subject: Re: XID formatting and SLRU refactorings (was: Add 64-bit XIDs into PostgreSQL 15)