File: CSSStyleSheet-insertRule.t

package info (click to toggle)
libcss-dom-perl 0.15-1%2Bdeb8u1
  • links: PTS, VCS
  • area: main
  • in suites: jessie
  • size: 716 kB
  • ctags: 249
  • sloc: perl: 7,310; makefile: 2
file content (22 lines) | stat: -rw-r--r-- 636 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
#!/usr/bin/perl -T

# This test is in its own file, because it checks to make sure that a cer-
# tain method does a ‘require’. We can’t test it if some other method has
# already done it.

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

use CSS::DOM;

use tests 1; # insertRule
my $ss = new CSS::DOM;
ok eval{$ss->insertRule('a{ color: red }',0);1},
	'insertRule on empty style sheet doesn\'t die';
	# At one point during development, it did die because it was call-
	# ing methods on CSS::DOM::RuleParser which hadn’t been loaded.