File: 20_autoload.t

package info (click to toggle)
libnet-ssleay-perl 1.36-1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 940 kB
  • ctags: 798
  • sloc: perl: 3,668; ansic: 2,711; makefile: 7
file content (38 lines) | stat: -rw-r--r-- 951 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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');