test cleanup
|
1 |
use strict; |
2 |
use warnings; |
|
3 | ||
4 |
use FindBin; |
|
5 |
$ENV{DBIX_CUSTOM_TEST_RUN} = 1; |
|
6 | ||
7 |
use DBIx::Custom; |
|
8 |
{ |
|
9 |
package DBIx::Custom; |
|
10 |
no warnings 'redefine'; |
|
finised sqlite quote test cl...
|
11 |
|
12 |
my $table1 = 'table1'; |
|
13 |
my $table2 = 'table2'; |
|
14 |
my $table2_alias = 'table2_alias'; |
|
15 |
my $table3 = 'table3'; |
|
16 |
my $key1 = 'key1'; |
|
17 |
my $key2 = 'key2'; |
|
18 |
my $key3 = 'key3'; |
|
19 |
my $key4 = 'key4'; |
|
20 |
my $key5 = 'key5'; |
|
21 |
my $key6 = 'key6'; |
|
22 |
my $key7 = 'key7'; |
|
23 |
my $key8 = 'key8'; |
|
24 |
my $key9 = 'key9'; |
|
25 |
my $key10 = 'key10'; |
|
26 |
|
|
27 |
has table1 => $table1; |
|
28 |
has table2 => $table2; |
|
29 |
has table2_alias => $table2_alias; |
|
30 |
has table3 => $table3; |
|
31 |
has key1 => $key1; |
|
32 |
has key2 => $key2; |
|
33 |
has key3 => $key3; |
|
34 |
has key4 => $key4; |
|
35 |
has key5 => $key5; |
|
36 |
has key6 => $key6; |
|
37 |
has key7 => $key7; |
|
38 |
has key8 => $key8; |
|
39 |
has key9 => $key9; |
|
40 |
has key10 => $key10; |
|
41 |
|
|
test cleanup
|
42 |
my $date_typename = 'Date'; |
43 |
my $datetime_typename = 'Datetime'; |
|
44 |
|
|
45 |
sub date_typename { lc $date_typename } |
|
46 |
sub datetime_typename { lc $datetime_typename } |
|
47 | ||
48 |
my $date_datatype = 'Date'; |
|
49 |
my $datetime_datatype = 'Datetime'; |
|
50 |
|
|
51 |
sub date_datatype { lc $date_datatype } |
|
52 |
sub datetime_datatype { lc $datetime_datatype } |
|
cleanup
|
53 | |
test cleanup
|
54 |
has dsn => 'dbi:SQLite:dbname=:memory:'; |
finised sqlite quote test cl...
|
55 |
sub create_table1 { "create table $table1 ($key1 varchar, $key2 varchar);" } |
56 |
sub create_table1_2 {"create table $table1 ($key1 varchar, $key2 varchar, $key3 varchar, key4 varchar, key5 varchar);" } |
|
57 |
sub create_table1_type { "create table $table1 ($key1 $date_typename, $key2 $datetime_typename);" } |
|
cleanup test
|
58 |
|
finised sqlite quote test cl...
|
59 |
sub create_table1_highperformance { "create table $table1 (key1 varchar, key2 varchar, key3 varchar, key4 varchar, key5 varchar, key6 varchar, key7 varchar);" } |
cleanup test
|
60 |
|
finised sqlite quote test cl...
|
61 |
sub create_table2 { "create table $table2 ($key1 varchar, $key3 varchar);" } |
62 |
sub create_table2_2 { "create table $table2 ($key1 varchar, $key2 varchar, $key3 varchar)" } |
|
63 |
sub create_table3 { "create table $table3 ($key1 varchar, $key2 varchar, $key3 varchar)" } |
|
cleanup test
|
64 |
sub create_table_reserved { 'create table "table" ("select" varchar, "update" varchar)' } |
finised sqlite quote test cl...
|
65 | |
66 |
sub quote { '""' } |
|
test cleanup
|
67 |
} |
68 | ||
69 |
require "$FindBin::Bin/common.t"; |