File: 13-duplicateids.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 (23 lines) | stat: -rwxr-xr-x 495 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
use strict;
use warnings;

use Test::More tests => 2;
use SVG;

# test: duplicate ids, -raiseerror

my $svga = SVG->new();
my $dupnotdetected = eval {
    $svga->group(id=>'the_group');
    $svga->group(id=>'the_group');
    1;
};

ok(!$dupnotdetected, "raiseerror");

my $svgb = SVG->new(-raiseerror => 0, -printerror => 0);
$svgb->group(id=>'the_group');
$svgb->group(id=>'the_group');
my $xml = $svgb->render();
like($xml, qr/errors=/, "raiseerror and printerror attribute in constructor");