Add the original source packages to maemo, source lenny
[dh-make-perl] / dev / i386 / libnet-ssleay-perl / libnet-ssleay-perl-1.35 / t / local / 20_autoload.t
diff --git a/dev/i386/libnet-ssleay-perl/libnet-ssleay-perl-1.35/t/local/20_autoload.t b/dev/i386/libnet-ssleay-perl/libnet-ssleay-perl-1.35/t/local/20_autoload.t
new file mode 100644 (file)
index 0000000..caa5bca
--- /dev/null
@@ -0,0 +1,38 @@
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+use Test::More;
+use Net::SSLeay;
+
+eval "use Test::Exception;";
+plan skip_all => 'Some tests need Test::Exception' if $@;
+
+plan tests => 6;
+
+{
+    my $const;
+    lives_ok(sub {
+            $const = Net::SSLeay::OP_NO_TLSv1();
+    }, 'some random constant exists');
+
+    ok( defined $const, '  and has a defined value' );
+}
+
+lives_ok(sub {
+        Net::SSLeay::make_form( foo => 'bar' );
+}, 'some random function gets autoloaded');
+
+
+throws_ok(sub {
+        Net::SSLeay::TXT_RC2_128_CBC_EXPORT40_WITH_MD5();
+}, qr/^Can't locate .*?TXT_RC2_128\.al/, 'disabled constant doesn\'t exist');
+
+throws_ok(sub {
+        Net::SSLeay::123x();
+}, qr/^Can't locate .*?123x\.al/, 'invalid constant doesn\'t exist' );
+
+throws_ok(sub {
+        Net::SSLeay::_TEST_INVALID_CONSTANT();
+}, qr/^Your vendor has not defined SSLeay macro _TEST_INVALID_CONSTANT /,
+'raises an appropriate error when an openssl macro isn\'t defined');