]> git.imager.perl.org - imager-screenshot.git/blobdiff - t/50darwin.t
add support for OS X Lion, which broke the old Darwin support
[imager-screenshot.git] / t / 50darwin.t
index 0a2d46b1fec31c22c6f48bba2cf929dd78a52c6f..0b450197600826913cc47cc01e78ae60c254f91d 100644 (file)
@@ -18,13 +18,22 @@ unless ($im) {
     or plan skip_all => "User doen't have a display";
 }
 
-plan tests => 7;
+plan tests => 8;
 
 {
   my $im = screenshot(darwin => 0);
   ok($im, "got an image");
-  is($im->getchannels, 3, "we have some color");
 
+  my $variant = $im->tags(name => "ss_variant");
+ SKIP:
+  {
+    # only the older version guarantees 3 channels
+    $variant eq "<11"
+      or skip "we can't be sure how many channels Lion returns", 1;
+    is($im->getchannels, 3, "we have some color");
+  }
+
+  like($variant, qr/^(<11|11\+)$/, "check ss_variant tag");
   is($im->tags(name => "ss_window_width"), $im->getwidth,
      "check ss_window_width tag");
   is($im->tags(name => 'ss_window_height'), $im->getheight,