diff options
author | Michael Paquier <michael@paquier.xyz> | 2022-06-08 11:24:06 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2022-06-08 11:24:06 +0900 |
commit | ca899d98b4aa50d80df9232c5c6ea9e4038cdf48 (patch) | |
tree | f917e3b130f7f3203a0969f420f47d710bb9b420 /src | |
parent | 4fff78f00910af0137f9de7532f8eb21d08ab1c3 (diff) | |
download | postgresql-ca899d98b4aa50d80df9232c5c6ea9e4038cdf48.tar.gz postgresql-ca899d98b4aa50d80df9232c5c6ea9e4038cdf48.zip |
Fix portability issue in TAP tests of psql for locales
Some locales use a comma as decimal separator (like Czech or French),
and psql's 001_basic.pl for \timing was not able to handle that
properly. This fixes the matching regexes to be able to handle both
comma and dot as possible decimal separators, as per a suggestion from
Andrew Dunstan.
psql tests were the only place with such a portability issue
(check-world passed here with a forced LANG/LANGUAGE). These tests are
new as of c0280bc, so there is no need for a backpatch.
Reported-by: Pavel Stehule
Discussion: https://postgr.es/m/CAFj8pRBz8iQmd2aOaCLvO-rJY6vZr-h6Q0qvV0J+yb78J7uiaA@mail.gmail.com
Diffstat (limited to 'src')
-rw-r--r-- | src/bin/psql/t/001_basic.pl | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/bin/psql/t/001_basic.pl b/src/bin/psql/t/001_basic.pl index d7e20f0ac61..44997467bf2 100644 --- a/src/bin/psql/t/001_basic.pl +++ b/src/bin/psql/t/001_basic.pl @@ -85,15 +85,15 @@ psql_like( '\timing on SELECT 1', qr/^1$ -^Time: \d+\.\d\d\d ms/m, +^Time: \d+[.,]\d\d\d ms/m, '\timing with successful query'); # test \timing with query that fails { my ($ret, $stdout, $stderr) = $node->psql('postgres', "\\timing on\nSELECT error"); isnt($ret, 0, '\timing with query error: query failed'); - like($stdout, qr/^Time: \d+\.\d\d\d ms/m, '\timing with query error: timing output appears'); - unlike($stdout, qr/^Time: 0\.000 ms/m, '\timing with query error: timing was updated'); + like($stdout, qr/^Time: \d+[.,]\d\d\d ms/m, '\timing with query error: timing output appears'); + unlike($stdout, qr/^Time: 0[.,]000 ms/m, '\timing with query error: timing was updated'); } # test that ENCODING variable is set and that it is updated when |