File: 05-doctype.t

package info (click to toggle)
libtest-html-content-perl 0.13-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 328 kB
  • sloc: perl: 1,393; makefile: 2
file content (25 lines) | stat: -rwxr-xr-x 814 bytes parent folder | download | duplicates (7)
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
#!/usr/bin/perl -w
use strict;
use lib 't';
use testlib;

sub run {
  use_ok('Test::HTML::Content');

  # Tests for comments
  has_declaration('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
  ', 'DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"', "Doctype 3.2");
  has_declaration('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
  ', qr'HTML', "Doctype via RE");
  has_declaration('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
  ', qr'DOCTYPE.*?HTML 3\.2',"Doctype via other RE");

  no_declaration('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
  ', qr'DOCTYPE.*?HtML 3\.2',"Doctype via other RE");
};

# Borked javadoc HTML DOCTYPE ...
#<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN""http://www.w3.org/TR/REC-html40/loose.dtd>

runtests( 1+4, \&run );