File: drawing-colorallocator.t

package info (click to toggle)
libchart-clicker-perl 2.90-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 696 kB
  • sloc: perl: 4,379; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 607 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
25
26
use Test::More;

use Graphics::Color::RGB;

BEGIN {
    use_ok('Chart::Clicker::Drawing::ColorAllocator');
}

my @seedcolors = (
    Graphics::Color::RGB->new({
        red     => 0,
        green   => 0,
        blue    => 0,
        alpha   => 1,
        name    => 'black'
    })
);
my $ca = Chart::Clicker::Drawing::ColorAllocator->new({
    colors => \@seedcolors
});
isa_ok($ca, 'Chart::Clicker::Drawing::ColorAllocator');
my $shouldbeblack = $ca->next;
ok(defined($shouldbeblack), 'Seeded color seems to be there');
cmp_ok($shouldbeblack->name, 'eq', 'black', 'Seeded color is black');

done_testing;