Re: change regexp_substr first argument make tests more easier to understand.

2024-09-05 Thread Tom Lane
Ilia Evdokimov writes: > Current tests with regexp_instr() and regexp_substr()  with string > 'abcabcabc' are really unreadable and you would spend time to understand > that happens in these tests and if they are really correct. I'd better > change them into "abcdefghi" just like in query >  

Re: change regexp_substr first argument make tests more easier to understand.

2024-08-13 Thread Ilia Evdokimov
Hi everybody Current tests with regexp_instr() and regexp_substr()  with string 'abcabcabc' are really unreadable and you would spend time to understand that happens in these tests and if they are really correct. I'd better change them into "abcdefghi" just like in query     SELECT regexp_su

Re: change regexp_substr first argument make tests more easier to understand.

2024-07-25 Thread jian he
On Fri, Jul 19, 2024 at 5:49 AM Tomas Vondra 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

Re: change regexp_substr first argument make tests more easier to understand.

2024-07-18 Thread Tomas Vondra
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 substrin

Re: change regexp_substr first argument make tests more easier to understand.

2023-12-27 Thread jian he
On Thu, Dec 28, 2023 at 12:13 AM jian he wrote: > > hi. > https://git.postgresql.org/cgit/postgresql.git/tree/src/test/regress/expected/strings.out#n928 > > SELECT regexp_substr('abcabcabc', 'a.c'); > SELECT regexp_substr('abcabcabc', 'a.c', 2); > SELECT regexp_substr('abcabcabc', 'a.c', 1, 3); >

change regexp_substr first argument make tests more easier to understand.

2023-12-27 Thread jian he
hi. https://git.postgresql.org/cgit/postgresql.git/tree/src/test/regress/expected/strings.out#n928 SELECT regexp_substr('abcabcabc', 'a.c'); SELECT regexp_substr('abcabcabc', 'a.c', 2); SELECT regexp_substr('abcabcabc', 'a.c', 1, 3); SELECT regexp_substr('abcabcabc', 'a.c', 1, 4) IS NULL AS t; SEL