X-Git-Url: http://git.maemo.org/git/?a=blobdiff_plain;ds=sidebyside;f=dev%2Fi386%2Flibnet-ssleay-perl%2Flibnet-ssleay-perl-1.35%2Ft%2Flocal%2F20_autoload.t;fp=dev%2Fi386%2Flibnet-ssleay-perl%2Flibnet-ssleay-perl-1.35%2Ft%2Flocal%2F20_autoload.t;h=caa5bca7641b2e0a01414cbf995a8a6c62166f8d;hb=8977e561d8a9eae6959218b0306c9df2056a38a9;hp=0000000000000000000000000000000000000000;hpb=df794b845212301ea0d267c919232538bfef356a;p=dh-make-perl 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 index 0000000..caa5bca --- /dev/null +++ b/dev/i386/libnet-ssleay-perl/libnet-ssleay-perl-1.35/t/local/20_autoload.t @@ -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');