"Fossies" - the Fresh Open Source Software Archive

Member "perl-5.32.1/cpan/HTTP-Tiny/t/001_api.t" (18 Dec 2020, 725 Bytes) of package /linux/misc/perl-5.32.1.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 #!perl
    2 
    3 use strict;
    4 use warnings;
    5 
    6 use Test::More tests => 2;
    7 use HTTP::Tiny;
    8 
    9 my @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 );
   13 my @methods   = qw(
   14   new get head put post delete post_form request mirror www_form_urlencode can_ssl
   15   connected
   16 );
   17 
   18 my %api;
   19 @api{@accessors} = (1) x @accessors;
   20 @api{@methods} = (1) x @methods;
   21 
   22 can_ok('HTTP::Tiny', @methods, @accessors);
   23 
   24 my @extra =
   25   grep {! $api{$_} }
   26   grep { $_ !~ /\A_/ }
   27   grep {; no strict 'refs'; *{"HTTP::Tiny::$_"}{CODE} }
   28   sort keys %HTTP::Tiny::;
   29 
   30 ok( ! scalar @extra, "No unexpected subroutines defined" )
   31   or diag "Found: @extra";