Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf339a99

Browse files
committed
Align better test output regex with grammar in pg_dump TAP tests
This enforces one-or-more character matches in the regular expressionsfor pg_dump testing on SQL syntax output where zero-or-more matchesimplies a syntax error.Author: Daniel GustafssonReviewed-by: David G. Johnston, Michael PaquierDiscussion:https://postgr.es/m/B313C32C-0E24-4AFB-95FF-6DA0C4E18A89@yesql.se
1 parent537898b commitf339a99

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

‎src/bin/pg_dump/t/002_pg_dump.pl

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -448,20 +448,20 @@
448448
},
449449

450450
'ALTER COLLATION test0 OWNER TO'=> {
451-
regexp=>qr/^\QALTER COLLATION public.test0 OWNER TO\E.*;/m,
451+
regexp=>qr/^\QALTER COLLATION public.test0 OWNER TO\E.+;/m,
452452
collation=> 1,
453453
like=> {%full_runs,section_pre_data=> 1, },
454454
unlike=> {%dump_test_schema_runs,no_owner=> 1, },
455455
},
456456

457457
'ALTER FOREIGN DATA WRAPPER dummy OWNER TO'=> {
458-
regexp=>qr/^ALTER FOREIGN DATA WRAPPER dummy OWNER TO .*;/m,
458+
regexp=>qr/^ALTER FOREIGN DATA WRAPPER dummy OWNER TO .+;/m,
459459
like=> {%full_runs,section_pre_data=> 1, },
460460
unlike=> {no_owner=> 1, },
461461
},
462462

463463
'ALTER SERVER s1 OWNER TO'=> {
464-
regexp=>qr/^ALTER SERVER s1 OWNER TO .*;/m,
464+
regexp=>qr/^ALTER SERVER s1 OWNER TO .+;/m,
465465
like=> {%full_runs,section_pre_data=> 1, },
466466
unlike=> {no_owner=> 1, },
467467
},
@@ -470,7 +470,7 @@
470470
regexp=>qr/^
471471
\QALTER FUNCTION dump_test.pltestlang_call_handler()\E
472472
\QOWNER TO\E
473-
.*;/xm,
473+
.+;/xm,
474474
like=>
475475
{%full_runs,%dump_test_schema_runs,section_pre_data=> 1, },
476476
unlike=> {
@@ -483,7 +483,7 @@
483483
regexp=>qr/^
484484
\QALTER OPERATOR FAMILY dump_test.op_family USING btree\E
485485
\QOWNER TO\E
486-
.*;/xm,
486+
.+;/xm,
487487
like=>
488488
{%full_runs,%dump_test_schema_runs,section_pre_data=> 1, },
489489
unlike=> {
@@ -522,7 +522,7 @@
522522
regexp=>qr/^
523523
\QALTER OPERATOR CLASS dump_test.op_class USING btree\E
524524
\QOWNER TO\E
525-
.*;/xm,
525+
.+;/xm,
526526
like=>
527527
{%full_runs,%dump_test_schema_runs,section_pre_data=> 1, },
528528
unlike=> {
@@ -532,13 +532,13 @@
532532
},
533533

534534
'ALTER PUBLICATION pub1 OWNER TO'=> {
535-
regexp=>qr/^ALTER PUBLICATION pub1 OWNER TO .*;/m,
535+
regexp=>qr/^ALTER PUBLICATION pub1 OWNER TO .+;/m,
536536
like=> {%full_runs,section_post_data=> 1, },
537537
unlike=> {no_owner=> 1, },
538538
},
539539

540540
'ALTER LARGE OBJECT ... OWNER TO'=> {
541-
regexp=>qr/^ALTER LARGE OBJECT\d+ OWNER TO .*;/m,
541+
regexp=>qr/^ALTER LARGE OBJECT\d+ OWNER TO .+;/m,
542542
like=> {
543543
%full_runs,
544544
column_inserts=> 1,
@@ -554,13 +554,13 @@
554554
},
555555

556556
'ALTER PROCEDURAL LANGUAGE pltestlang OWNER TO'=> {
557-
regexp=>qr/^ALTER PROCEDURAL LANGUAGE pltestlang OWNER TO .*;/m,
557+
regexp=>qr/^ALTER PROCEDURAL LANGUAGE pltestlang OWNER TO .+;/m,
558558
like=> {%full_runs,section_pre_data=> 1, },
559559
unlike=> {no_owner=> 1, },
560560
},
561561

562562
'ALTER SCHEMA dump_test OWNER TO'=> {
563-
regexp=>qr/^ALTER SCHEMA dump_test OWNER TO .*;/m,
563+
regexp=>qr/^ALTER SCHEMA dump_test OWNER TO .+;/m,
564564
like=>
565565
{%full_runs,%dump_test_schema_runs,section_pre_data=> 1, },
566566
unlike=> {
@@ -570,7 +570,7 @@
570570
},
571571

572572
'ALTER SCHEMA dump_test_second_schema OWNER TO'=> {
573-
regexp=>qr/^ALTER SCHEMA dump_test_second_schema OWNER TO .*;/m,
573+
regexp=>qr/^ALTER SCHEMA dump_test_second_schema OWNER TO .+;/m,
574574
like=> {
575575
%full_runs,
576576
role=> 1,
@@ -757,7 +757,7 @@
757757
},
758758

759759
'ALTER TABLE test_table OWNER TO'=> {
760-
regexp=>qr/^\QALTER TABLE dump_test.test_table OWNER TO\E.*;/m,
760+
regexp=>qr/^\QALTER TABLE dump_test.test_table OWNER TO\E.+;/m,
761761
like=> {
762762
%full_runs,
763763
%dump_test_schema_runs,
@@ -790,7 +790,7 @@
790790
},
791791

792792
'ALTER TABLE test_second_table OWNER TO'=> {
793-
regexp=>qr/^\QALTER TABLE dump_test.test_second_table OWNER TO\E.*;/m,
793+
regexp=>qr/^\QALTER TABLE dump_test.test_second_table OWNER TO\E.+;/m,
794794
like=>
795795
{%full_runs,%dump_test_schema_runs,section_pre_data=> 1, },
796796
unlike=> {
@@ -800,7 +800,7 @@
800800
},
801801

802802
'ALTER TABLE measurement OWNER TO'=> {
803-
regexp=>qr/^\QALTER TABLE dump_test.measurement OWNER TO\E.*;/m,
803+
regexp=>qr/^\QALTER TABLE dump_test.measurement OWNER TO\E.+;/m,
804804
like=>
805805
{%full_runs,%dump_test_schema_runs,section_pre_data=> 1, },
806806
unlike=> {
@@ -811,7 +811,7 @@
811811

812812
'ALTER TABLE measurement_y2006m2 OWNER TO'=> {
813813
regexp=>
814-
qr/^\QALTER TABLE dump_test_second_schema.measurement_y2006m2 OWNER TO\E.*;/m,
814+
qr/^\QALTER TABLE dump_test_second_schema.measurement_y2006m2 OWNER TO\E.+;/m,
815815
like=> {
816816
%full_runs,
817817
role=> 1,
@@ -822,7 +822,7 @@
822822

823823
'ALTER FOREIGN TABLE foreign_table OWNER TO'=> {
824824
regexp=>
825-
qr/^\QALTER FOREIGN TABLE dump_test.foreign_table OWNER TO\E.*;/m,
825+
qr/^\QALTER FOREIGN TABLE dump_test.foreign_table OWNER TO\E.+;/m,
826826
like=>
827827
{%full_runs,%dump_test_schema_runs,section_pre_data=> 1, },
828828
unlike=> {
@@ -833,7 +833,7 @@
833833

834834
'ALTER TEXT SEARCH CONFIGURATION alt_ts_conf1 OWNER TO'=> {
835835
regexp=>
836-
qr/^\QALTER TEXT SEARCH CONFIGURATION dump_test.alt_ts_conf1 OWNER TO\E.*;/m,
836+
qr/^\QALTER TEXT SEARCH CONFIGURATION dump_test.alt_ts_conf1 OWNER TO\E.+;/m,
837837
like=>
838838
{%full_runs,%dump_test_schema_runs,section_pre_data=> 1, },
839839
unlike=> {
@@ -844,7 +844,7 @@
844844

845845
'ALTER TEXT SEARCH DICTIONARY alt_ts_dict1 OWNER TO'=> {
846846
regexp=>
847-
qr/^\QALTER TEXT SEARCH DICTIONARY dump_test.alt_ts_dict1 OWNER TO\E.*;/m,
847+
qr/^\QALTER TEXT SEARCH DICTIONARY dump_test.alt_ts_dict1 OWNER TO\E.+;/m,
848848
like=>
849849
{%full_runs,%dump_test_schema_runs,section_pre_data=> 1, },
850850
unlike=> {
@@ -895,14 +895,14 @@
895895
},
896896

897897
'COMMENT ON DATABASE postgres'=> {
898-
regexp=>qr/^COMMENT ON DATABASE postgres IS .*;/m,
898+
regexp=>qr/^COMMENT ON DATABASE postgres IS .+;/m,
899899

900900
# Should appear in the same tests as "CREATE DATABASE postgres"
901901
like=> {createdb=> 1, },
902902
},
903903

904904
'COMMENT ON EXTENSION plpgsql'=> {
905-
regexp=>qr/^COMMENT ON EXTENSION plpgsql IS .*;/m,
905+
regexp=>qr/^COMMENT ON EXTENSION plpgsql IS .+;/m,
906906

907907
# this shouldn't ever get emitted anymore
908908
like=> {},
@@ -1353,7 +1353,7 @@
13531353
'CREATE DATABASE postgres'=> {
13541354
regexp=>qr/^
13551355
\QCREATE DATABASE postgres WITH TEMPLATE = template0\E
1356-
.*;/xm,
1356+
.+;/xm,
13571357
like=> {createdb=> 1, },
13581358
},
13591359

@@ -1362,7 +1362,7 @@
13621362
create_sql=>'CREATE DATABASE dump_test;',
13631363
regexp=>qr/^
13641364
\QCREATE DATABASE dump_test WITH TEMPLATE = template0\E
1365-
.*;/xm,
1365+
.+;/xm,
13661366
like=> {pg_dumpall_dbprivs=> 1, },
13671367
},
13681368

@@ -2651,7 +2651,7 @@
26512651
26522652
'DROP ROLE pg_' => {
26532653
regexp => qr/^
2654-
\QDROP ROLE pg_\E.*;
2654+
\QDROP ROLE pg_\E.+;
26552655
/xm,
26562656
26572657
# this shouldn't ever get emitted anywhere

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp