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