summaryrefslogtreecommitdiff
path: root/t/07-file.t
diff options
context:
space:
mode:
Diffstat (limited to 't/07-file.t')
-rw-r--r--t/07-file.t24
1 files changed, 24 insertions, 0 deletions
diff --git a/t/07-file.t b/t/07-file.t
new file mode 100644
index 0000000..1bd448c
--- /dev/null
+++ b/t/07-file.t
@@ -0,0 +1,24 @@
+#!/usr/bin/perl
+
+use strict;
+
+use Test::More tests => 10;
+
+use_ok('Graphics::ColorNames', 1.10, qw( hex2tuple tuple2hex ));
+
+tie my %colors, 'Graphics::ColorNames', './t/rgb.txt';
+ok(tied %colors);
+
+ok(keys %colors == 6); #
+
+my $count = 0;
+foreach my $name (keys %colors)
+ {
+ my @RGB = hex2tuple( $colors{$name} );
+ $count++, if (tuple2hex(@RGB) eq $colors{$name} );
+ }
+ok($count == keys %colors);
+
+foreach my $name (qw( one two three four five six)) {
+ ok(exists $colors{$name});
+}