added common test executing ...
|
1 |
use strict; |
2 |
use warnings; |
|
3 | ||
4 |
use FindBin; |
|
5 |
$ENV{DBIX_CUSTOM_TEST_RUN} = 1 |
|
added run file
|
6 |
if -f "$FindBin::Bin/run/common-postgresql.run"; |
added common test executing ...
|
7 |
$ENV{DBIX_CUSTOM_SKIP_MESSAGE} = 'postgresql private test'; |
8 | ||
9 |
use DBIx::Custom; |
|
10 |
{ |
|
11 |
package DBIx::Custom; |
|
12 |
no warnings 'redefine'; |
|
cleanup
|
13 | |
finised postgresql test clea...
|
14 |
my $table1 = 'table1'; |
15 |
my $table2 = 'table2'; |
|
16 |
my $table2_alias = 'table2_alias'; |
|
17 |
my $table3 = 'table3'; |
|
18 |
my $key1 = 'key1'; |
|
19 |
my $key2 = 'key2'; |
|
20 |
my $key3 = 'key3'; |
|
21 |
my $key4 = 'key4'; |
|
22 |
my $key5 = 'key5'; |
|
23 |
my $key6 = 'key6'; |
|
24 |
my $key7 = 'key7'; |
|
25 |
my $key8 = 'key8'; |
|
26 |
my $key9 = 'key9'; |
|
27 |
my $key10 = 'key10'; |
|
28 |
|
|
29 |
has table1 => $table1; |
|
30 |
has table2 => $table2; |
|
31 |
has table2_alias => $table2_alias; |
|
32 |
has table3 => $table3; |
|
33 |
has key1 => $key1; |
|
34 |
has key2 => $key2; |
|
35 |
has key3 => $key3; |
|
36 |
has key4 => $key4; |
|
37 |
has key5 => $key5; |
|
38 |
has key6 => $key6; |
|
39 |
has key7 => $key7; |
|
40 |
has key8 => $key8; |
|
41 |
has key9 => $key9; |
|
42 |
has key10 => $key10; |
|
43 | ||
test cleanup
|
44 |
my $date_typename = 'Date'; |
45 |
my $datetime_typename = 'Timestamp'; |
|
46 | ||
47 |
sub date_typename { lc $date_typename } |
|
48 |
sub datetime_typename { 'timestamp without time zone' } |
|
49 | ||
50 |
my $date_datatype = 91; |
|
51 |
my $datetime_datatype = 11; |
|
52 | ||
53 |
sub date_datatype { lc $date_datatype } |
|
54 |
sub datetime_datatype { lc $datetime_datatype } |
|
cleanup
|
55 | |
test cleanup
|
56 |
has dsn => "dbi:Pg:dbname=dbix_custom"; |
57 |
has user => 'dbix_custom'; |
|
58 |
has password => 'dbix_custom'; |
|
update pod
|
59 |
has exclude_table => sub { |
added EXPERIMENTAL system_ta...
|
60 | |
61 |
return qr/^( |
|
62 |
pg_|column_|role_|view_|sql_ |
|
63 |
|applicable_roles |
|
64 |
|check_constraints |
|
65 |
|columns |
|
66 |
|constraint_column_usage |
|
67 |
|constraint_table_usage |
|
68 |
|data_type_privileges |
|
69 |
|domain_constraints |
|
70 |
|domain_udt_usage |
|
71 |
|domains |
|
72 |
|element_types |
|
73 |
|enabled_roles |
|
update pod
|
74 |
|information_schema |
added EXPERIMENTAL system_ta...
|
75 |
|information_schema_catalog_name |
76 |
|key_column_usage |
|
77 |
|parameters |
|
78 |
|referential_constraints |
|
79 |
|routine_privileges |
|
80 |
|routines |
|
81 |
|schemata |
|
82 |
|table_constraints |
|
83 |
|table_privileges |
|
84 |
|tables |
|
85 |
|triggered_update_columns |
|
86 |
|triggers |
|
87 |
|usage_privileges |
|
88 |
|views |
|
89 |
)/x |
|
90 |
}; |
|
added common test executing ...
|
91 |
|
finised postgresql test clea...
|
92 |
sub create_table1 { "create table $table1 ($key1 varchar(255), $key2 varchar(255));" } |
93 |
sub create_table1_2 {"create table $table1 ($key1 varchar(255), $key2 varchar(255), " |
|
94 |
. "$key3 varchar(255), $key4 varchar(255), $key5 varchar(255));" } |
|
95 |
sub create_table1_type { "create table $table1 ($key1 $date_typename, $key2 $datetime_typename);" } |
|
96 |
sub create_table1_highperformance { "create table $table1 ($key1 varchar(255), $key2 varchar(255), " |
|
97 |
. "$key3 varchar(255), $key4 varchar(255), $key5 varchar(255), $key6 varchar(255), $key7 varchar(255));" } |
|
98 |
sub create_table2 { "create table $table2 ($key1 varchar(255), $key3 varchar(255));" } |
|
99 |
sub create_table2_2 { "create table $table2 ($key1 varchar(255), $key2 varchar(255), $key3 varchar(255))" } |
|
100 |
sub create_table3 { "create table $table3 ($key1 varchar(255), $key2 varchar(255), $key3 varchar(255))" } |
|
test cleanup
|
101 |
sub create_table_reserved { 'create table "table" ("select" varchar(255), "update" varchar(255))' } |
added common test executing ...
|
102 |
} |
103 | ||
104 |
require "$FindBin::Bin/common.t"; |