APR-HTTP-Headers-Compat
view release on metacpan or search on metacpan
use lib 'inc';
use Module::Build;
use MyBuilder;
my $builder = MyBuilder->new(
module_name => 'APR::HTTP::Headers::Compat',
license => 'perl',
dist_author => 'Andy Armstrong <andy@hexten.net>',
dist_version_from => 'lib/APR/HTTP/Headers/Compat.pm',
recursive_test_files => 1,
requires => {
'APR::Pool' => 0,
'APR::Table' => 0,
'HTTP::Headers' => 0,
'Storable' => 0,
'Test::More' => 0,
},
add_to_cleanup => ['APR-HTTP-Headers-Compat-*'],
);
APR-HTTP-Headers-Compat version 0.02
INSTALLATION
To install this module, run the following commands:
perl Build.PL
./Build
./Build test
./Build install
DEPENDENCIES
None.
COPYRIGHT AND LICENCE
Copyright (C) 2009, Andy Armstrong
inc/MyBuilder.pm view on Meta::CPAN
$url =~ s!^git\@github\.com:!git://github.com/!;
return $url;
}
return;
}
sub _auto_bugtracker {
'http://rt.cpan.org/NoAuth/Bugs.html?Dist=' . shift->dist_name;
}
sub ACTION_testauthor {
my $self = shift;
$self->test_files( 'xt/author' );
$self->ACTION_test;
}
sub ACTION_critic {
exec qw( perlcritic -1 -q -profile perlcriticrc lib/ ), glob 't/*.t';
}
sub ACTION_tags {
exec(
qw(
ctags -f tags --recurse --totals
t/00.load.t view on Meta::CPAN
use Test::More tests => 1;
BEGIN {
use_ok( 'APR::HTTP::Headers::Compat' );
}
diag(
"Testing APR::HTTP::Headers::Compat $APR::HTTP::Headers::Compat::VERSION"
);
#!perl
use strict;
use warnings;
use APR::HTTP::Headers::Compat;
use APR::Pool;
use APR::Table;
use Test::More tests => 10;
my $Pool = APR::Pool->new;
{
my $table = APR::Table::make( $Pool, 1 );
ok my $h = APR::HTTP::Headers::Compat->new( $table ), 'new';
$h->header( 'Content-Type', 'text/plain' );
is_deeply [ tcont( $table ) ], [ 'Content-Type', 'text/plain' ],
'add';
$h->push_header( 'Foo' => 1 );
t/compat/base/headers-etag.t view on Meta::CPAN
#!perl -w
use strict;
use Test::More tests => 4;
use APR::Pool;
use APR::Table;
use APR::HTTP::Headers::Compat;
use HTTP::Headers::ETag;
my $Pool = APR::Pool->new;
sub mk(@) {
my $table = APR::Table::make( $Pool, 10 );
t/compat/base/headers.t view on Meta::CPAN
#!perl -w
use strict;
use Test::More tests => 163;
use APR::Pool;
use APR::Table;
use APR::HTTP::Headers::Compat;
my ( $h, $h2 );
sub j { join( "|", @_ ) }
my $Pool = APR::Pool->new;
sub mk(@) {
t/compat/base/headers.t view on Meta::CPAN
EOT
is( $h->as_string, <<EOT);
Date: today
User-Agent: libwww-perl
ETag: abc
Content: none
Zoo: foo
EOT
# separate code path for the void context case, so test it as well
$h2->remove_content_headers;
is( $h->as_string, $h2->as_string );
$h->clear;
is( $h->as_string, "" );
undef( $h2 );
$h = mk;
is( $h->header_field_names, 0 );
is( j( $h->header_field_names ), "" );
t/compat/base/headers.t view on Meta::CPAN
is( $h->content_encoding, undef );
is( $h->content_encoding( "gzip" ), undef );
is( $h->content_encoding, "gzip" );
is( j( $h->header_field_names ), "Content-Encoding|Content-Type" );
is( $h->content_language, undef );
is( $h->content_language( "no" ), undef );
is( $h->content_language, "no" );
is( $h->title, undef );
is( $h->title( "This is a test" ), undef );
is( $h->title, "This is a test" );
is( $h->user_agent, undef );
is( $h->user_agent( "Mozilla/1.2" ), undef );
is( $h->user_agent, "Mozilla/1.2" );
is( $h->server, undef );
is( $h->server( "Apache/2.1" ), undef );
is( $h->server, "Apache/2.1" );
is( $h->from( "Gisle\@ActiveState.com" ), undef );
t/compat/base/headers.t view on Meta::CPAN
is( $h->referrer->as_string, "http://www.example.com" );
is( $h->as_string, <<EOT);
From: Gisle\@ActiveState.com
Referer: http://www.example.com
User-Agent: Mozilla/1.2
Server: Apache/2.1
Content-Encoding: gzip
Content-Language: no
Content-Type: text/html;
charSet = "ISO-8859-1"; Foo=1
Title: This is a test
EOT
}
$h->clear;
is( $h->www_authenticate( "foo" ), undef );
is( $h->www_authenticate( "bar" ), "foo" );
is( $h->www_authenticate, "bar" );
is( $h->proxy_authenticate( "foo" ), undef );
is( $h->proxy_authenticate( "bar" ), "foo" );
is( $h->proxy_authenticate, "bar" );
t/compat/base/headers.t view on Meta::CPAN
is( j( $h->proxy_authorization_basic ), "u2|p2" );
is( $h->proxy_authorization, "Basic dTI6cDI=" );
is( $h->as_string, <<EOT);
Authorization: Basic dTpw
Proxy-Authorization: Basic dTI6cDI=
Proxy-Authenticate: bar
WWW-Authenticate: bar
EOT
#---- old tests below -----
$h = mk(
mime_version => "1.0",
content_type => "text/html"
);
$h->header( URI => "http://www.oslonett.no/" );
is( $h->header( "MIME-Version" ), "1.0" );
is( $h->header( 'Uri' ), "http://www.oslonett.no/" );
t/pod-coverage.t view on Meta::CPAN
#!perl -T
use Test::More;
eval "use Test::Pod::Coverage 1.04";
plan skip_all =>
"Test::Pod::Coverage 1.04 required for testing POD coverage"
if $@;
all_pod_coverage_ok( { private => [ qr{^[A-Z]+$}, qr{^_} ] } );
#!perl -T
use Test::More;
eval "use Test::Pod 1.14";
plan skip_all => "Test::Pod 1.14 required for testing POD" if $@;
all_pod_files_ok();
( run in 0.350 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )