Change to Attribute::Handlers suggested by Damian in
[p5sagit/p5-mst-13.2.git] / lib / 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
5BEGIN {
6 if ($ENV{PERL_CORE}) {
7 chdir 't' if -d 't';
8 @INC = '../lib';
9 }
10}
11
12use Test::More tests => 8;
13
14package LoudDecl;
15use Attribute::Handlers;
16
17sub Loud :ATTR {
18 my ($package, $symbol, $referent, $attr, $data, $phase) = @_;
19
20 ::is_deeply( $data, $referent->(), *{$symbol}{NAME} );
21}
22
23
24sub test1 :Loud(till=>ears=>are=>bleeding) {
25 [qw(till ears are bleeding)]
26}
27
28sub test2 :Loud(['till','ears','are','bleeding']) {
0ca82094 29 [qw(till ears are bleeding)]
7f0eb64d 30}
31
32sub test3 :Loud(qw/till ears are bleeding/) {
33 [qw(till ears are bleeding)]
34}
35
36sub test4 :Loud(qw/my, ears, are, bleeding/) {
37 [('my,', 'ears,', 'are,', 'bleeding')]
38}
39
40sub test5 :Loud(till,ears,are,bleeding) {
41 [qw(till ears are bleeding)]
42}
43
44sub test6 :Loud(my,ears,are,bleeding) {
45 'my,ears,are,bleeding';
46}
47
48sub test7 :Loud(qw/my ears are bleeding) {
49 'qw/my ears are bleeding'; #'
50}
51
52sub test8 :Loud("turn it up to 11, man!") {
53 'turn it up to 11, man!';
54}