File: 01basic.t

package info (click to toggle)
libhtml-html5-builder-perl 0.004-4
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 344 kB
  • sloc: perl: 3,427; makefile: 15
file content (25 lines) | stat: -rw-r--r-- 610 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
use Test::More tests => 2;
BEGIN { use_ok('HTML::HTML5::Builder') };

HTML::HTML5::Builder->import(qw'meta :standard');

my $document = html(
	-lang => 'en',
	head(
		title('Test', \(my $foo)),
		COMMENT('Foo'),
		meta(-charset => 'utf-8'),
	),
	body(
		h1('Test'),
		p('This is a test.'),
		XML_CHUNK('<p>Yet another test.</p><div>Foo</div>'),
	),
	RAW_CHUNK('<!--?>'),
);

$foo->setAttribute('lang', 'en-GB');

is("$document",
	'<!DOCTYPE html><html lang=en><title lang=en-GB>Test</title><!--Foo--><meta charset=utf-8><h1>Test</h1><p>This is a test.<p>Yet another test.</p><div>Foo</div><!--?>',
	'Works.');