File: create.t

package info (click to toggle)
libcss-inliner-perl 4024-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 412 kB
  • sloc: perl: 882; makefile: 2
file content (29 lines) | stat: -rw-r--r-- 569 bytes parent folder | download
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
use strict;
use warnings;
use lib qw( ./lib ../lib );

use Test::More;
plan(tests => 2);

use_ok('CSS::Inliner::Parser');

my $simple = CSS::Inliner::Parser->new();

#test creation of empty selector
$simple->add_qualified_rule({ selector => '.empty', declarations => [] });

#test creation of initialized selector
$simple->add_qualified_rule({ selector => '.bar', declarations => [ color => 'blue', 'font-size' => '16px' ] });

my $ordered = $simple->write();

my $expected = <<END;
.empty {
}
.bar {
  color: blue;
  font-size: 16px;
}
END

ok($expected eq $ordered);