File: 02-brush.t

package info (click to toggle)
libgraphics-primitive-perl 0.67-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 372 kB
  • sloc: perl: 2,586; makefile: 2
file content (28 lines) | stat: -rw-r--r-- 705 bytes parent folder | download | duplicates (5)
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
use Test::More tests => 8;

BEGIN {
    use_ok('Graphics::Primitive::Brush');
}

my $obj = Graphics::Primitive::Brush->new(
    width => 3,
    line_cap => 'round',
    line_join => 'bevel'
);

cmp_ok($obj->width, '==', 3, 'width');
cmp_ok($obj->line_cap, 'eq', 'round', 'line_cap');
cmp_ok($obj->line_join, 'eq', 'bevel', 'line_join');

my $obj2 = $obj->clone;
ok($obj2->equal_to($obj), 'equal_to');

$obj->dash_pattern([ 1, 2, 3]);
$obj2->dash_pattern([ 1, 2, 3]);
ok($obj2->equal_to($obj), 'equal_to - dash_pattern');

my $obj3 = $obj->derive({ width => 4 });
ok($obj3->not_equal_to($obj), 'not_equal_to');

$obj2->dash_pattern([ 1, 2, 4]);
ok($obj2->not_equal_to($obj), 'not_equal_to - dash_pattern');