DBIx-Custom / t / common-sqlite.t /
Newer Older
70 lines | 2.102kb
added common test executing ...
Yuki Kimoto authored on 2011-08-07
1
use strict;
2
use warnings;
3

            
4
use FindBin;
test cleanup
Yuki Kimoto authored on 2011-08-15
5
use lib "$FindBin::Bin/common";
added common test executing ...
Yuki Kimoto authored on 2011-08-07
6
$ENV{DBIX_CUSTOM_TEST_RUN} = 1;
7

            
8
use DBIx::Custom;
9
{
cleanup
Yuki Kimoto authored on 2012-01-20
10
  package DBIx::Custom;
11
  no warnings 'redefine';
12
  
13
  my $table1 = 'table1';
14
  my $table2 = 'table2';
15
  my $table2_alias = 'table2_alias';
16
  my $table3 = 'table3';
17
  my $key1 = 'key1';
18
  my $key2 = 'key2';
19
  my $key3 = 'key3';
20
  my $key4 = 'key4';
21
  my $key5 = 'key5';
22
  my $key6 = 'key6';
23
  my $key7 = 'key7';
24
  my $key8 = 'key8';
25
  my $key9 = 'key9';
26
  my $key10 = 'key10';
27
  
28
  has table1 => $table1;
29
  has table2 => $table2;
30
  has table2_alias => $table2_alias;
31
  has table3 => $table3;
32
  has key1 => $key1;
33
  has key2 => $key2;
34
  has key3 => $key3;
35
  has key4 => $key4;
36
  has key5 => $key5;
37
  has key6 => $key6;
38
  has key7 => $key7;
39
  has key8 => $key8;
40
  has key9 => $key9;
41
  has key10 => $key10;
fixed setup method logic
Yuki Kimoto authored on 2012-03-02
42
  has default_schema => 'main';
cleanup
Yuki Kimoto authored on 2012-01-20
43
  
44
  my $date_typename = 'Date';
45
  my $datetime_typename = 'Datetime';
46
  
47
  sub date_typename { lc $date_typename }
48
  sub datetime_typename { lc $datetime_typename }
test cleanup
Yuki Kimoto authored on 2011-08-10
49

            
cleanup
Yuki Kimoto authored on 2012-01-20
50
  my $date_datatype = 'Date';
51
  my $datetime_datatype = 'Datetime';
52
  
53
  sub date_datatype { lc $date_datatype }
54
  sub datetime_datatype { lc $datetime_datatype }
fixed SQL Server tests
Yuki Kimoto authored on 2011-08-14
55

            
cleanup
Yuki Kimoto authored on 2012-01-20
56
  has dsn => 'dbi:SQLite:dbname=:memory:';
57
  sub create_table1 { "create table $table1 ($key1 varchar, $key2 varchar)" }
58
  sub create_table1_2 {"create table $table1 ($key1 varchar, $key2 varchar, $key3 varchar, key4 varchar, key5 varchar)" }
59
  sub create_table1_type { "create table $table1 ($key1 $date_typename, $key2 $datetime_typename)" }
60
  
61
  sub create_table1_highperformance { "create table $table1 (key1 varchar, key2 varchar, key3 varchar, key4 varchar, key5 varchar, key6 varchar, key7 varchar)" }
62
  
63
  sub create_table2 { "create table $table2 ($key1 varchar, $key3 varchar)" }
64
  sub create_table2_2 { "create table $table2 ($key1 varchar, $key2 varchar, $key3 varchar)" }
65
  sub create_table3 { "create table $table3 ($key1 varchar, $key2 varchar, $key3 varchar)" }
66
  sub create_table_reserved { 'create table "table" ("select" varchar, "update" varchar)' }
67
  
added common test executing ...
Yuki Kimoto authored on 2011-08-07
68
}
69

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