5 use Test::More tests => 7;
8 my $data = '0123456789' x 100;
9 my $len = length $data;
11 ok( my $bio = Net::SSLeay::BIO_new( &Net::SSLeay::BIO_s_mem ), 'BIO_new' );
12 is( Net::SSLeay::BIO_write($bio, $data), $len, 'BIO_write' );
13 is( Net::SSLeay::BIO_pending($bio), $len, 'BIO_pending' );
16 is( Net::SSLeay::BIO_read($bio, $read_len), substr($data, 0, $read_len), 'BIO_read part' );
17 is( Net::SSLeay::BIO_pending($bio), $len - $read_len, 'BIO_pending' );
19 is( Net::SSLeay::BIO_read($bio), substr($data, $read_len), 'BIO_read rest' );
21 ok( Net::SSLeay::BIO_free($bio), 'BIO_free' );