1#!/usr/bin/perl -w
2
3# Test attribute data conversion using examples from the docs
4
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']) {
22    [[qw(till ears are bleeding)]]
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
37sub test6 :Loud(my,ears,are,bleeding) {
38    'my,ears,are,bleeding';
39}
40
41sub test7 :Loud(qw/my ears are bleeding) {
42    'qw/my ears are bleeding'; #'
43}
44
45sub test8 :Loud("turn it up to 11, man!") {
46    ['turn it up to 11, man!'];
47}
48