File: nolint.t

package info (click to toggle)
libhtml-lint-perl 2.32%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 356 kB
  • sloc: perl: 1,739; makefile: 6
file content (45 lines) | stat: -rw-r--r-- 1,328 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
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#!perl

use warnings;
use strict;

use lib 't/';
use Util;

checkit( [
    [ 'elem-img-sizes-missing' => qr/\Q<img src="alpha.jpg"> tag has no HEIGHT and WIDTH attributes/i ],
    [ 'elem-img-alt-missing'   => qr/\Q<img src="alpha.jpg"> does not have ALT text defined/i ],

    [ 'elem-img-alt-missing'   => qr/\Q<img src="beta.jpg"> does not have ALT text defined/i ],

    # gamma.jpg will not error at all

    [ 'elem-img-alt-missing'   => qr/\Q<img src="delta.jpg"> does not have ALT text defined/i ],

    [ 'elem-img-sizes-missing' => qr/\Q<img src="epsilon.jpg"> tag has no HEIGHT and WIDTH attributes/i ],
    [ 'elem-img-alt-missing'   => qr/\Q<img src="epsilon.jpg"> does not have ALT text defined/i ],
    [ 'elem-unclosed'          => 'Set #1 (20:5) <gooble> at (13:9) is never closed' ],
], [<DATA>] );

__DATA__
<html>
    <head>
        <title>Test stuff</title>
    </head>
    <body bgcolor="white">
        <img src="alpha.jpg">

        <!-- html-lint elem-img-sizes-missing: off, attr-unknown: off -->
        <img src="beta.jpg" />

        <!-- html-lint all: off -->
        <img src="gamma.jpg" />
        <gooble darble="fungo" />

        <!-- html-lint elem-img-alt-missing: on -->
        <img src="delta.jpg">

        <!-- html-lint all: on -->
        <img src="epsilon.jpg">
    </body>
</html>