xref: /openbsd/gnu/usr.bin/perl/cpan/HTTP-Tiny/t/001_api.t (revision 3cab2bb3)
1#!perl
2
3use strict;
4use warnings;
5
6use Test::More tests => 2;
7use HTTP::Tiny;
8
9my @accessors = qw(
10  agent default_headers http_proxy https_proxy keep_alive local_address
11  max_redirect max_size proxy no_proxy timeout SSL_options verify_SSL cookie_jar
12);
13my @methods   = qw(
14  new get head put post delete post_form request mirror www_form_urlencode can_ssl
15  connected
16);
17
18my %api;
19@api{@accessors} = (1) x @accessors;
20@api{@methods} = (1) x @methods;
21
22can_ok('HTTP::Tiny', @methods, @accessors);
23
24my @extra =
25  grep {! $api{$_} }
26  grep { $_ !~ /\A_/ }
27  grep {; no strict 'refs'; *{"HTTP::Tiny::$_"}{CODE} }
28  sort keys %HTTP::Tiny::;
29
30ok( ! scalar @extra, "No unexpected subroutines defined" )
31  or diag "Found: @extra";
32