line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Data; |
2
|
6
|
|
|
6
|
|
286046
|
use strict; |
|
6
|
|
|
|
|
41
|
|
|
6
|
|
|
|
|
312
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
our $VERSION = '1.242'; |
5
|
|
|
|
|
|
|
|
6
|
6
|
|
|
6
|
|
43
|
use Carp qw(carp); |
|
6
|
|
|
|
|
14
|
|
|
6
|
|
|
|
|
369
|
|
7
|
|
|
|
|
|
|
|
8
|
6
|
|
|
6
|
|
40
|
use Test::Builder; |
|
6
|
|
|
|
|
13
|
|
|
6
|
|
|
|
|
1153
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
my $Test = Test::Builder->new(); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
=encoding utf8 |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
=head1 NAME |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
Test::Data -- test functions for particular variable types |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
=head1 SYNOPSIS |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
use Test::Data qw(Scalar Array Hash Function); |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
=head1 DESCRIPTION |
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
Test::Data provides utility functions to check properties |
25
|
|
|
|
|
|
|
and values of data and variables. |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
=cut |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
$Exporter::Verbose = 0; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
sub import { |
32
|
6
|
|
|
6
|
|
57
|
my $self = shift; |
33
|
6
|
|
|
|
|
15
|
my $caller = caller; |
34
|
|
|
|
|
|
|
|
35
|
6
|
|
|
|
|
23
|
foreach my $package ( @_ ) { |
36
|
8
|
|
|
|
|
29
|
my $full_package = "Test::Data::$package"; |
37
|
8
|
|
|
|
|
16
|
eval{ eval "require $full_package" }; |
|
8
|
|
|
|
|
450
|
|
38
|
8
|
50
|
|
|
|
47
|
if( $@ ) { |
39
|
0
|
|
|
|
|
0
|
carp "Could not require Test::Data::$package: $@"; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
8
|
|
|
|
|
7484
|
$full_package->Exporter::export($caller); |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head2 Functions |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
Plug-in modules define functions for each data type. See the |
50
|
|
|
|
|
|
|
appropriate module. |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head2 How it works |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
The Test::Data module simply emports functions from Test::Data::* |
55
|
|
|
|
|
|
|
modules. Each module defines a self-contained function, and puts |
56
|
|
|
|
|
|
|
that function name into @EXPORT. Test::Data defines its own |
57
|
|
|
|
|
|
|
import function, but that does not matter to the plug-in modules. |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
If you want to write a plug-in module, follow the example of one |
60
|
|
|
|
|
|
|
that already exists. Name the module Test::Data::Foo, where you |
61
|
|
|
|
|
|
|
replace Foo with the right name. Test::Data should automatically |
62
|
|
|
|
|
|
|
find it. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
=head1 BUGS |
65
|
|
|
|
|
|
|
|
66
|
|
|
|
|
|
|
I'm not a very good Windows Perler, so some things don't work as |
67
|
|
|
|
|
|
|
they should on Windows. I recently got a Windows box so I can |
68
|
|
|
|
|
|
|
test things, but if you run into problems, I can use all the |
69
|
|
|
|
|
|
|
patches or advice you care to send. |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 SEE ALSO |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
L, |
74
|
|
|
|
|
|
|
L, |
75
|
|
|
|
|
|
|
L, |
76
|
|
|
|
|
|
|
L, |
77
|
|
|
|
|
|
|
L |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=head1 SOURCE AVAILABILITY |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
This source is in Github: |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
https://github.com/briandfoy/test-data |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=head1 AUTHOR |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
brian d foy, C<< >> |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
Copyright © 2002-2018, brian d foy . All rights reserved. |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify |
94
|
|
|
|
|
|
|
it under the terms of the Artistic License 2.0. |
95
|
|
|
|
|
|
|
|
96
|
|
|
|
|
|
|
=cut |
97
|
|
|
|
|
|
|
|
98
|
|
|
|
|
|
|
"Now is the time for all good men to come to the aid of their country"; |