]> iEval git - convert-color-husl.git/commitdiff
Get test coverage to 100%
authorMarius Gavrilescu <marius@ieval.ro>
Thu, 9 Jul 2015 12:29:52 +0000 (15:29 +0300)
committerMarius Gavrilescu <marius@ieval.ro>
Thu, 9 Jul 2015 12:29:52 +0000 (15:29 +0300)
MANIFEST
t/accessors.t [new file with mode: 0644]

index e61d62cd1f73dfbea79dcf3b7afb77d18c372916..e7996a7e4e06b435bede1d3f2c141f24c2516565 100644 (file)
--- 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 (file)
index 0000000..fcff024
--- /dev/null
@@ -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"
+}
This page took 0.018165 seconds and 4 git commands to generate.