DBIx-Custom / t / common-sqlite-quote.t /
Newer Older
69 lines | 2.172kb
test cleanup
Yuki Kimoto authored on 2011-08-08
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...
Yuki Kimoto authored on 2011-08-15
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
Yuki Kimoto authored on 2011-08-10
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
Yuki Kimoto authored on 2011-08-10
53

            
test cleanup
Yuki Kimoto authored on 2011-08-10
54
    has dsn => 'dbi:SQLite:dbname=:memory:';
finised sqlite quote test cl...
Yuki Kimoto authored on 2011-08-15
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
Yuki Kimoto authored on 2011-08-10
58
    
finised sqlite quote test cl...
Yuki Kimoto authored on 2011-08-15
59
    sub create_table1_highperformance { "create table $table1 (key1 varchar, key2 varchar, key3 varchar, key4 varchar, key5 varchar, key6 varchar, key7 varchar);" }
cleanup test
Yuki Kimoto authored on 2011-08-10
60
    
finised sqlite quote test cl...
Yuki Kimoto authored on 2011-08-15
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
Yuki Kimoto authored on 2011-08-10
64
    sub create_table_reserved { 'create table "table" ("select" varchar, "update" varchar)' }
finised sqlite quote test cl...
Yuki Kimoto authored on 2011-08-15
65

            
66
    sub quote { '""' }
test cleanup
Yuki Kimoto authored on 2011-08-08
67
}
68

            
69
require "$FindBin::Bin/common.t";