This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
RT 72933: Ignore files from prove
[perl5.git] / dist / Attribute-Handlers / t / data_convert.t
CommitLineData
7f0eb64d
MS
1#!/usr/bin/perl -w
2
3# Test attribute data conversion using examples from the docs
4
7f0eb64d
MS
5use Test::More tests => 8;
6
7package LoudDecl;
8use Attribute::Handlers;
9
10sub Loud :ATTR {
11 my ($package, $symbol, $referent, $attr, $data, $phase) = @_;
12
13 ::is_deeply( $data, $referent->(), *{$symbol}{NAME} );
14}
15
16
17sub test1 :Loud(till=>ears=>are=>bleeding) {
18 [qw(till ears are bleeding)]
19}
20
21sub test2 :Loud(['till','ears','are','bleeding']) {
2560d050 22 [[qw(till ears are bleeding)]]
7f0eb64d
MS
23}
24
25sub test3 :Loud(qw/till ears are bleeding/) {
26 [qw(till ears are bleeding)]
27}
28
29sub test4 :Loud(qw/my, ears, are, bleeding/) {
30 [('my,', 'ears,', 'are,', 'bleeding')]
31}
32
33sub test5 :Loud(till,ears,are,bleeding) {
34 [qw(till ears are bleeding)]
35}
36
1313c7b1
RGS
37sub test6 :Loud(my,ears,are,bleeding) {
38 'my,ears,are,bleeding';
7f0eb64d
MS
39}
40
1313c7b1
RGS
41sub test7 :Loud(qw/my ears are bleeding) {
42 'qw/my ears are bleeding'; #'
43}
7f0eb64d 44
1313c7b1 45sub test8 :Loud("turn it up to 11, man!") {
2560d050 46 ['turn it up to 11, man!'];
1313c7b1 47}