first cut of XML::Tags
[catagits/Web-Simple.git] / t / tags.t
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   }
22 }
23
24 is(
25   join(', ', Foo::foo()),
26   '<one>, <two>, <three>',
27   'open tags ok'
28 );
29
30 ok(!eval { Foo::bar(); 1 }, 'Death on use of unimported tag');
31
32 is(
33   join(', ', Foo::baz()),
34   '</bar>',
35   'close tag ok'
36 );