File: elem-input-alt-missing.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 (34 lines) | stat: -rw-r--r-- 1,143 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
#!perl

use warnings;
use strict;

use lib 't/';
use Util;

checkit( [
    [ 'elem-input-alt-missing' => qr/<input name="dave" type="image"> does not have non-blank ALT text defined/i ],
    [ 'elem-input-alt-missing' => qr/<input name="empty-alt" type="image"> does not have non-blank ALT text defined/i ],
    [ 'elem-input-alt-missing' => qr/<input name="all-whitespace-alt" type="image"> does not have non-blank ALT text defined/i ],
    [ 'elem-input-alt-missing' => qr/<input name="" type="image"> does not have non-blank ALT text defined/i ],
], [<DATA>] );

__DATA__
<html>
    <head>
        <title>Test stuff</title>
    </head>
    <body bgcolor="#ffffff">
        <p align="right">
            This is my paragraph
        </p>
        <form method="post" action="foo.php">
            <input type="image" name="dave" />
            <input type="image" name="empty-alt" alt="" />
            <input name="all-whitespace-alt" type="image" alt="    " />
            <input type="image" />
            <input name="ok" type="image" alt="Blah blah" />
            <input type="text" name="bongo" />
        </form>
    </BODY>
</HTML>