File: 60-add-tags.t

package info (click to toggle)
libhtml-lint-perl 2.22%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 356 kB
  • ctags: 87
  • sloc: perl: 1,102; sh: 54; makefile: 20
file content (32 lines) | stat: -rw-r--r-- 798 bytes parent folder | download
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
26
27
28
29
30
31
32
#!perl

use warnings;
use strict;

require 't/LintTest.pl';

use HTML::Lint::HTML4;

# This test is the same as t/attr-unknown.t, but with tag table modification.

HTML::Lint::HTML4::add_attribute( 'p', 'food' );
HTML::Lint::HTML4::add_attribute( 'body', 'cuisine' );

HTML::Lint::HTML4::add_tag( 'meal' );
HTML::Lint::HTML4::add_attribute( 'meal', 'type' );

checkit( [
    [ 'attr-unknown' => qr/Unknown attribute "Yummy" for tag <I>/i ],
], [<DATA>] );

__DATA__
<HTML>
    <HEAD>
        <TITLE>Test stuff</TITLE>
    </HEAD>
    <BODY BGCOLOR="white" cuisine="Mexican">
        <P FOOD="Burrito" ALIGN=RIGHT>This is my paragraph about burritos</P>
        <I YUMMY="Spanish Rice">This is my paragraph about refried beans</I>
        <meal type="lunch">Steak burrito</meal>
    </BODY>
</HTML>