Commit | Line | Data |
afe60e53 |
1 | use strict; use warnings FATAL => 'all'; |
2 | use Test::More qw(no_plan); |
3 | |
4 | { |
5 | |
6 | package Foo; |
7 | |
8 | sub foo { |
9 | use XML::Tags qw(one two three); |
10 | <one>, <two>, <three>; |
11 | } |
12 | |
13 | sub bar { |
14 | no warnings 'once'; # this is supposed to warn, it's broken |
15 | <one> |
16 | } |
17 | |
18 | sub baz { |
19 | use XML::Tags qw(bar); |
20 | </bar>; |
21 | } |
cb5717ef |
22 | |
23 | sub quux { |
24 | use HTML::Tags; |
cc050137 |
25 | <html>, <body id="spoon">, "YAY", </body>, </html>; |
cb5717ef |
26 | } |
43a70ddb |
27 | |
28 | sub globbery { |
29 | <t/globbery/*>; |
30 | } |
afe60e53 |
31 | } |
32 | |
33 | is( |
49a6c0b5 |
34 | join(', ', XML::Tags::to_xml_string Foo::foo()), |
afe60e53 |
35 | '<one>, <two>, <three>', |
36 | 'open tags ok' |
37 | ); |
38 | |
39 | ok(!eval { Foo::bar(); 1 }, 'Death on use of unimported tag'); |
40 | |
41 | is( |
49a6c0b5 |
42 | join(', ', XML::Tags::to_xml_string Foo::baz()), |
afe60e53 |
43 | '</bar>', |
44 | 'close tag ok' |
45 | ); |
cb5717ef |
46 | |
47 | is( |
49a6c0b5 |
48 | join('', HTML::Tags::to_html_string Foo::quux), |
cb5717ef |
49 | '<html><body id="spoon">YAY</body></html>', |
50 | 'HTML tags ok' |
51 | ); |
43a70ddb |
52 | |
53 | is( |
54 | join(', ', Foo::globbery), |
55 | 't/globbery/one, t/globbery/two', |
56 | 'real glob re-installed ok' |
57 | ); |