xref: /openbsd-src/gnu/usr.bin/perl/cpan/autodie/t/lib/Hints_provider_does.pm (revision b8851fcc53cbe24fd20b090f26dd149e353f6174)
1b39c5158Smillertpackage Hints_provider_does;
2b39c5158Smillertuse strict;
3b39c5158Smillertuse warnings;
4*b8851fccSafresh1use Exporter 5.57 'import';
5b39c5158Smillert
6b39c5158Smillertour @EXPORT_OK = qw(always_fail always_pass no_hints);
7b39c5158Smillert
8b39c5158Smillertsub DOES {
9b39c5158Smillert    my ($class, $arg) = @_;
10b39c5158Smillert
11b39c5158Smillert    return 1 if ($arg eq 'autodie::hints::provider');
12b39c5158Smillert    return $class->SUPER::DOES($arg) if $class->SUPER::can('DOES');
13b39c5158Smillert    return $class->isa($arg);
14b39c5158Smillert}
15b39c5158Smillert
16b39c5158Smillertmy $package = __PACKAGE__;
17b39c5158Smillert
18b39c5158Smillertsub AUTODIE_HINTS {
19b39c5158Smillert    return {
20b39c5158Smillert        always_fail => { list => sub { 1 }, scalar => sub { 1 } },
21b39c5158Smillert        always_pass => { list => sub { 0 }, scalar => sub { 0 } },
22b39c5158Smillert    };
23b39c5158Smillert}
24b39c5158Smillert
25b39c5158Smillertsub always_fail { return "foo" };
26b39c5158Smillertsub always_pass { return "foo" };
27b39c5158Smillertsub no_hints    { return "foo" };
28b39c5158Smillert
29b39c5158Smillert1;
30