File Coverage

blib/lib/Test/Data.pm
Criterion Covered Total %
statement 19 20 95.0
branch 1 2 50.0
condition n/a
subroutine 5 5 100.0
pod n/a
total 25 27 92.5


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