File: CSSRuleList.t

package info (click to toggle)
libcss-dom-perl 0.17-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 592 kB
  • sloc: perl: 7,310; makefile: 2
file content (25 lines) | stat: -rw-r--r-- 529 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 -T

use strict; use warnings;
our $tests;
BEGIN { ++$INC{'tests.pm'} }
sub tests'VERSION { $tests += pop };
use Test::More;
plan tests => $tests;

use tests 1; # use
use_ok 'CSS::DOM::RuleList';

require CSS::DOM;
my $ss = CSS::DOM::parse('a{text-decoration: none} p { margin: 0 }');
my $list = cssRules $ss;

use tests 1; # isa
isa_ok $list, 'CSS::DOM::RuleList';

use tests 1; # length
is $list->length, @$list, 'length';

use tests 2; # item
is $list->item($_), $list->[$_], 'item ' . 'again' x $_ for 0..1;