basic HTML tags
[catagits/Web-Simple.git] / t / tags.t
CommitLineData
afe60e53 1use strict; use warnings FATAL => 'all';
2use 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;
25 <html>, <body id="spoon">, "YAY", </body>, </html>;
26 }
afe60e53 27}
28
29is(
30 join(', ', Foo::foo()),
31 '<one>, <two>, <three>',
32 'open tags ok'
33);
34
35ok(!eval { Foo::bar(); 1 }, 'Death on use of unimported tag');
36
37is(
38 join(', ', Foo::baz()),
39 '</bar>',
40 'close tag ok'
41);
cb5717ef 42
43is(
44 join('', Foo::quux),
45 '<html><body id="spoon">YAY</body></html>',
46 'HTML tags ok'
47);