File: declaration.t

package info (click to toggle)
libhtml-restrict-perl 3.0.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 364 kB
  • sloc: perl: 842; makefile: 7
file content (22 lines) | stat: -rw-r--r-- 534 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env perl

use warnings;
use strict;

use HTML::Restrict ();
use Test::More;

my $hr = HTML::Restrict->new;

my $text = '<!DOCTYPE HTML> ';
$hr->debug(1);

is $hr->process($text), q{}, 'declaration not preserved';
$hr->allow_declaration(1);
is $hr->process($text), '<!DOCTYPE HTML>', 'declaration is preserved';

$text
    = q{<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">};
is $hr->process($text), $text, 'declaration preserved';

done_testing();