File: 13-duplicateids.t

package info (click to toggle)
libsvg-perl 2.87-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 464 kB
  • sloc: perl: 2,789; makefile: 2
file content (24 lines) | stat: -rw-r--r-- 531 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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" );