Move Attribute::Handlers from ext/ to dist/
[p5sagit/p5-mst-13.2.git] / dist / Attribute-Handlers / t / data_convert.t
CommitLineData
7f0eb64d 1#!/usr/bin/perl -w
2
3# Test attribute data conversion using examples from the docs
4
7f0eb64d 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 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 37sub test6 :Loud(my,ears,are,bleeding) {
38 'my,ears,are,bleeding';
7f0eb64d 39}
40
1313c7b1 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}