File: 21-polygon.t

package info (click to toggle)
libsvg-perl 2.52-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 412 kB
  • sloc: perl: 2,433; makefile: 2
file content (39 lines) | stat: -rwxr-xr-x 667 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
35
36
37
38
39
use strict;
use warnings;

use Test::More tests => 4;

use SVG;

# test: style

my $svg = SVG->new;
my $defs = $svg->defs();

diag 'a five-sided polygon';
my $xv = [0,2,4,5,1];
my $yv = [0,0,2,7,5];

my $points = $svg->get_path(
        x=>$xv, y=>$yv,
        -type=>'polygon'
    );

my $c = $svg->polygon(
        %$points,
        id      => 'pgon1',
        style   => {
            fill   => 'red',
            stroke =>'green',
        },
	opacity => 0.6,
);

ok($c,"polygon 1: define");

my $out = $svg->xmlify();

like($out, qr/polygon/, "polygon 2: serialize");
like($out, qr/style/,   "inline css style 1");
like($out, qr/opacity/, "inline css style 2");