Hints_test.pm revision 1.1
1package Hints_test;
2use strict;
3use warnings;
4
5use base qw(Exporter);
6
7our @EXPORT_OK = qw(
8    fail_on_empty fail_on_false fail_on_undef
9);
10
11use autodie::hints;
12
13# Create some dummy subs that just return their arguments.
14
15sub fail_on_empty { return @_; }
16sub fail_on_false { return @_; }
17sub fail_on_undef { return @_; }
18
19# Set them to different failure modes when used with autodie.
20
21autodie::hints->set_hints_for(
22    \&fail_on_empty, {
23        list => autodie::hints::EMPTY_ONLY ,
24        scalar => autodie::hints::EMPTY_ONLY
25    }
26);
27
28autodie::hints->set_hints_for(
29    \&fail_on_false, {
30        list => autodie::hints::EMPTY_OR_FALSE ,
31        scalar => autodie::hints::EMPTY_OR_FALSE
32    }
33);
34
35autodie::hints->set_hints_for(
36    \&fail_on_undef, {
37        list => autodie::hints::EMPTY_OR_UNDEF ,
38        scalar => autodie::hints::EMPTY_OR_UNDEF
39    }
40);
41
421;
43