From: Marius Gavrilescu Date: Thu, 9 Jul 2015 12:29:52 +0000 (+0300) Subject: Get test coverage to 100% X-Git-Tag: 0.002001~2 X-Git-Url: http://git.ieval.ro/?a=commitdiff_plain;h=ddcfafb25e8ee2214b92c0d89f3104fd190d36ce;p=convert-color-husl.git Get test coverage to 100% --- diff --git a/MANIFEST b/MANIFEST index e61d62c..e7996a7 100644 --- a/MANIFEST +++ b/MANIFEST @@ -2,6 +2,7 @@ Changes Makefile.PL MANIFEST README +t/accessors.t t/Convert-Color-HUSL.t t/perlcriticrc t/perlcritic.t 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" +}