test default color for box drawing
authorTony Cook <tony@develop=help.com>
Sun, 5 Sep 2010 02:57:01 +0000 (02:57 +0000)
committerTony Cook <tony@develop=help.com>
Sun, 5 Sep 2010 02:57:01 +0000 (02:57 +0000)
t/t21draw.t

index da3d19c59be78a8bb6ca0f16916719fe83c7ba4f..ac86f1cab5ea57e5babf8596971662ff0bd11288 100644 (file)
@@ -1,6 +1,6 @@
 #!perl -w
 use strict;
-use Test::More tests => 238;
+use Test::More tests => 244;
 use Imager ':all';
 use Imager::Test qw(is_color3);
 use constant PI => 3.14159265358979;
@@ -274,6 +274,27 @@ my $white = '#FFFFFF';
      "save arc through 0");
 }
 
+{
+  # test drawing color defaults
+  {
+    my $im = Imager->new(xsize => 10, ysize => 10);
+    ok($im->box(), "default outline the image"); # should outline the image
+    is_color3($im->getpixel(x => 0, y => 0), 255, 255, 255,
+             "check outline default color TL");
+    is_color3($im->getpixel(x => 9, y => 5), 255, 255, 255,
+             "check outline default color MR");
+  }
+
+  {
+    my $im = Imager->new(xsize => 10, ysize => 10);
+    ok($im->box(filled => 1), "default fill the image"); # should fill the image
+    is_color3($im->getpixel(x => 0, y => 0), 255, 255, 255,
+             "check fill default color TL");
+    is_color3($im->getpixel(x => 5, y => 5), 255, 255, 255,
+             "check fill default color MM");
+  }
+}
+
 malloc_state();
 
 unless ($ENV{IMAGER_KEEP_FILES}) {