File: lowercase.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 (29 lines) | stat: -rw-r--r-- 601 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
#!/usr/bin/env perl

use strict;
use warnings;

use Test::More;
use Test::Fatal    qw( exception );
use HTML::Restrict ();

my $html
    = q{<!doctype html><!-- comments go here --><body onLoad="stuff">foo</body>};

like(
    exception {
        my $hr = HTML::Restrict->new( rules => { Body => ['onload'] } );
    },
    qr{tag names must be lower cased},
    'dies on mixed case tag names',
);

like(
    exception {
        my $hr = HTML::Restrict->new( rules => { body => ['onLoad'] } );
    },
    qr{attribute names must be lower cased},
    'dies on mixed case attributes',
);

done_testing();