Get test coverage to 100%
[convert-color-husl.git] / t / accessors.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.009256 seconds and 4 git commands to generate.