]> git.imager.perl.org - imager.git/commitdiff
add a test for the preload method
authorTony Cook <tony@develop-help.com>
Thu, 29 Oct 2015 23:32:49 +0000 (10:32 +1100)
committerTony Cook <tony@develop-help.com>
Thu, 29 Oct 2015 23:32:49 +0000 (10:32 +1100)
Imager.pm
MANIFEST
t/200-file/450-preload.t [new file with mode: 0644]

index 905d68428905c816c32cff3652b43c6f23d4b600..cc4ecb23b2ad2558c8e7612d8fff0e2c6bddd2eb 100644 (file)
--- a/Imager.pm
+++ b/Imager.pm
@@ -4343,6 +4343,8 @@ sub preload {
   eval { require Imager::Font::FT2 };
   eval { require Imager::Font::T1 };
   eval { require Imager::Color::Table };
+
+  1;
 }
 
 package Imager::IO;
index c91279a28b315bbcc6b485fa3a3d9d5eda4924ca..e8dd2560d05c59cd5b46a077eb485b6593bab32f 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -334,6 +334,7 @@ t/200-file/310-pnm.t                Test PNM file handling
 t/200-file/320-bmp.t           Test BMP file handling
 t/200-file/330-tga.t           Test TGA file handling
 t/200-file/400-basic.t         Test basic operations across file formats
+t/200-file/450-preload.t       Test the preload class method
 t/250-draw/010-draw.t          Basic drawing tests
 t/250-draw/020-flood.t         Flood fill tests
 t/250-draw/030-paste.t         Test the paste() method
diff --git a/t/200-file/450-preload.t b/t/200-file/450-preload.t
new file mode 100644 (file)
index 0000000..ac83a01
--- /dev/null
@@ -0,0 +1,8 @@
+#!perl -w
+use strict;
+use Imager;
+use Test::More tests => 2;
+
+$@ = "Hello";
+ok(Imager->preload, "preload doesn't die");
+is($@, "Hello", "check \$@ was preserved");