X-Git-Url: http://git.ieval.ro/?p=convert-color-husl.git;a=blobdiff_plain;f=t%2Faccessors.t;fp=t%2Faccessors.t;h=fcff0241b0a22b39a0858fea41710e87cee529af;hp=0000000000000000000000000000000000000000;hb=ddcfafb25e8ee2214b92c0d89f3104fd190d36ce;hpb=5fe5621619cabcccaccc1b2de34654f32d1dc475 diff --git a/t/accessors.t b/t/accessors.t new file mode 100644 index 0000000..fcff024 --- /dev/null +++ b/t/accessors.t @@ -0,0 +1,23 @@ +#!/usr/bin/perl +use 5.008009; +use strict; +use warnings; + +use Convert::Color; +use Test::More tests => 16; + +my @tests = ( + [qw/husl H S L hsl/], + [qw/lch L C h lch/], + [qw/luv L u v luv/], + [qw/xyz X Y Z xyz/], +); + +for (@tests) { + my ($name, $x, $y, $z, $xyz) = @$_; + my $col = Convert::Color->new("$name:1,2,3"); + is $col->$x, 1, "\$$name->$x"; + is $col->$y, 2, "\$$name->$y"; + is $col->$z, 3, "\$$name->$z"; + is_deeply [$col->$xyz], [1, 2, 3], "\$$name->$xyz" +}