-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy path04mods.t
59 lines (41 loc) · 1.82 KB
/
04mods.t
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!perl -w
$|=1;
use strict;
use Test::More tests => 12;
## ----------------------------------------------------------------------------
## 04mods.t - ...
## ----------------------------------------------------------------------------
# Note:
# the modules tested here are all marked as new and not guaranteed, so this if
# they change, these will fail.
## ----------------------------------------------------------------------------
BEGIN {
use_ok( 'DBI' );
# load these first, since the other two load them
# and we want to catch the error first
use_ok( 'DBI::Const::GetInfo::ANSI' );
use_ok( 'DBI::Const::GetInfo::ODBC' );
use_ok( 'DBI::Const::GetInfoType', qw(%GetInfoType) );
use_ok( 'DBI::Const::GetInfoReturn', qw(%GetInfoReturnTypes %GetInfoReturnValues) );
}
## test GetInfoType
cmp_ok(scalar(keys(%GetInfoType)), '>', 1, '... we have at least one key in the GetInfoType hash');
is_deeply(
\%GetInfoType,
{ %DBI::Const::GetInfo::ANSI::InfoTypes, %DBI::Const::GetInfo::ODBC::InfoTypes },
'... the GetInfoType hash is constructed from the ANSI and ODBC hashes'
);
## test GetInfoReturnTypes
cmp_ok(scalar(keys(%GetInfoReturnTypes)), '>', 1, '... we have at least one key in the GetInfoReturnType hash');
is_deeply(
\%GetInfoReturnTypes,
{ %DBI::Const::GetInfo::ANSI::ReturnTypes, %DBI::Const::GetInfo::ODBC::ReturnTypes },
'... the GetInfoReturnType hash is constructed from the ANSI and ODBC hashes'
);
## test GetInfoReturnValues
cmp_ok(scalar(keys(%GetInfoReturnValues)), '>', 1, '... we have at least one key in the GetInfoReturnValues hash');
# ... testing GetInfoReturnValues any further would be difficult
## test the two methods found in DBI::Const::GetInfoReturn
can_ok('DBI::Const::GetInfoReturn', 'Format');
can_ok('DBI::Const::GetInfoReturn', 'Explain');
1;