r70539 - in /branches/upstream/libplack-perl/current: ./ lib/ lib/Plack/ lib/Plack/Middleware/ lib/Plack/Server/ lib/Plack/Test/ t/HTTP-Server-PSGI/ t/Plack-Loader/ t/Plack-Middleware/ t/Plack-Middleware/stacktrace/ t/Plack-Request/ t/Plack-Test/

jawnsy-guest at users.alioth.debian.org jawnsy-guest at users.alioth.debian.org
Sat Mar 5 22:29:05 UTC 2011


Author: jawnsy-guest
Date: Sat Mar  5 22:28:56 2011
New Revision: 70539

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=70539
Log:
[svn-upgrade] new version libplack-perl (0.9974)

Added:
    branches/upstream/libplack-perl/current/lib/Plack/Middleware/IIS6ScriptNameFix.pm
    branches/upstream/libplack-perl/current/t/Plack-Middleware/iis6_script_name_fix.t
    branches/upstream/libplack-perl/current/t/Plack-Middleware/wrapcgi_exec.t
Modified:
    branches/upstream/libplack-perl/current/Changes
    branches/upstream/libplack-perl/current/MANIFEST
    branches/upstream/libplack-perl/current/META.yml
    branches/upstream/libplack-perl/current/lib/Plack.pm
    branches/upstream/libplack-perl/current/lib/Plack/Request.pm
    branches/upstream/libplack-perl/current/lib/Plack/Response.pm
    branches/upstream/libplack-perl/current/lib/Plack/Server/ServerSimple.pm
    branches/upstream/libplack-perl/current/lib/Plack/Test.pm
    branches/upstream/libplack-perl/current/lib/Plack/Test/Suite.pm
    branches/upstream/libplack-perl/current/t/HTTP-Server-PSGI/post.t
    branches/upstream/libplack-perl/current/t/Plack-Loader/auto.t
    branches/upstream/libplack-perl/current/t/Plack-Middleware/chunked.t
    branches/upstream/libplack-perl/current/t/Plack-Middleware/component-leak.t
    branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace/sigdie.t
    branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace/utf8.t
    branches/upstream/libplack-perl/current/t/Plack-Middleware/urlmap_ports.t
    branches/upstream/libplack-perl/current/t/Plack-Middleware/wrapcgi.t
    branches/upstream/libplack-perl/current/t/Plack-Request/double_port.t
    branches/upstream/libplack-perl/current/t/Plack-Request/upload-large.t
    branches/upstream/libplack-perl/current/t/Plack-Test/2args.t
    branches/upstream/libplack-perl/current/t/Plack-Test/hello_server.t

Modified: branches/upstream/libplack-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/Changes?rev=70539&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/Changes (original)
+++ branches/upstream/libplack-perl/current/Changes Sat Mar  5 22:28:56 2011
@@ -1,6 +1,13 @@
 Revision history for Perl extension Plack
 
 Take a look at http://github.com/miyagawa/Plack/issues for the planned changes before 1.0 release.
+
+0.9974  Thu Mar  3 20:55:28 PST 2011
+        - Added a documentation about using relative URI paths beginning with //
+        - Added IIS6ScriptNameFix that fixes SCRIPT_NAME for IIS6 FastCGI, extracted from Catalyst (rafl)
+        - Moved the wrapcgi/exec tests for Win32 #174
+        - Fixed a warning for the new Test::TCP in FCGI testing
+        - Clear %ENV when running the Plack::Test::Suite with Server implementation (hachi)
 
 0.9973  Sat Feb 26 09:40:15 PST 2011
         - Fixed the regexp in the code check added in 0.9972 (leedo)

Modified: branches/upstream/libplack-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/MANIFEST?rev=70539&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/MANIFEST (original)
+++ branches/upstream/libplack-perl/current/MANIFEST Sat Mar  5 22:28:56 2011
@@ -85,6 +85,7 @@
 lib/Plack/Middleware/ErrorDocument.pm
 lib/Plack/Middleware/Head.pm
 lib/Plack/Middleware/HTTPExceptions.pm
+lib/Plack/Middleware/IIS6ScriptNameFix.pm
 lib/Plack/Middleware/JSONP.pm
 lib/Plack/Middleware/LighttpdScriptNameFix.pm
 lib/Plack/Middleware/Lint.pm
@@ -187,6 +188,7 @@
 t/Plack-Middleware/htpasswd
 t/Plack-Middleware/httpexceptions.t
 t/Plack-Middleware/httpexceptions_streaming.t
+t/Plack-Middleware/iis6_script_name_fix.t
 t/Plack-Middleware/jsonp.t
 t/Plack-Middleware/lint.t
 t/Plack-Middleware/lint_utf8_false_alarm.t
@@ -217,6 +219,7 @@
 t/Plack-Middleware/urlmap_env.t
 t/Plack-Middleware/urlmap_ports.t
 t/Plack-Middleware/wrapcgi.t
+t/Plack-Middleware/wrapcgi_exec.t
 t/Plack-Middleware/xframework.t
 t/Plack-Middleware/xsendfile.t
 t/Plack-MIME/add_type.t

Modified: branches/upstream/libplack-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/META.yml?rev=70539&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/META.yml (original)
+++ branches/upstream/libplack-perl/current/META.yml Sat Mar  5 22:28:56 2011
@@ -40,4 +40,4 @@
   homepage: http://plackperl.org
   license: http://dev.perl.org/licenses/
   repository: git://github.com/miyagawa/Plack.git
-version: 0.9973
+version: 0.9974

Modified: branches/upstream/libplack-perl/current/lib/Plack.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack.pm?rev=70539&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack.pm Sat Mar  5 22:28:56 2011
@@ -3,7 +3,7 @@
 use strict;
 use warnings;
 use 5.008_001;
-our $VERSION = '0.9973';
+our $VERSION = '0.9974';
 $VERSION = eval $VERSION;
 
 1;

Added: branches/upstream/libplack-perl/current/lib/Plack/Middleware/IIS6ScriptNameFix.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Middleware/IIS6ScriptNameFix.pm?rev=70539&op=file
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Middleware/IIS6ScriptNameFix.pm (added)
+++ branches/upstream/libplack-perl/current/lib/Plack/Middleware/IIS6ScriptNameFix.pm Sat Mar  5 22:28:56 2011
@@ -1,0 +1,57 @@
+package Plack::Middleware::IIS6ScriptNameFix;
+
+use strict;
+use parent 'Plack::Middleware';
+
+sub call {
+    my($self, $env) = @_;
+
+    if ($env->{SERVER_SOFTWARE} && $env->{SERVER_SOFTWARE} =~ /IIS\/[6-9]\.[0-9]/) {
+        my @script_name = split(m!/!, $env->{PATH_INFO});
+        my @path_translated = split(m!/|\\\\?!, $env->{PATH_TRANSLATED});
+        my @path_info;
+
+        while ($script_name[$#script_name] eq $path_translated[$#path_translated]) {
+            pop(@path_translated);
+            unshift(@path_info, pop(@script_name));
+        }
+
+        unshift(@path_info, '', '');
+
+        $env->{PATH_INFO} = join('/', @path_info);
+        $env->{SCRIPT_NAME} = join('/', @script_name);
+    }
+
+    return $self->app->($env);
+}
+
+1;
+
+__END__
+
+=head1 NAME
+
+Plack::Middleware::IIS6ScriptNameFix - fixes wrong SCRIPT_NAME and PATH_INFO that IIS6 sets
+
+=head1 SYNOPSIS
+
+  # in your app.psgi
+  use Plack::Builder;
+
+  builder {
+    enable "IIS6ScriptNameFix";
+    $app;
+  };
+
+  # Or from the command line
+  plackup -s FCGI -e 'enable "IIS6ScriptNameFix"' /path/to/app.psgi
+
+=head1 DESCRIPTION
+
+This middleware fixes wrong C<SCRIPT_NAME> and C<PATH_INFO> set by IIS6.
+
+=head1 AUTHORS
+
+Florian Ragwitz
+
+=cut

Modified: branches/upstream/libplack-perl/current/lib/Plack/Request.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Request.pm?rev=70539&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Request.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Request.pm Sat Mar  5 22:28:56 2011
@@ -2,7 +2,7 @@
 use strict;
 use warnings;
 use 5.008_001;
-our $VERSION = '0.9973';
+our $VERSION = '0.9974';
 $VERSION = eval $VERSION;
 
 use HTTP::Headers;
@@ -369,7 +369,7 @@
 =head1 METHODS
 
 Some of the methods defined in the earlier versions are deprecated in
-version 1.00. Take a look at L</"INCOMPATIBILITIES">.
+version 0.99. Take a look at L</"INCOMPATIBILITIES">.
 
 Unless otherwise noted, all methods and attributes are B<read-only>,
 and passing values to the method like an accessor doesn't work like
@@ -642,7 +642,7 @@
 
 =head1 INCOMPATIBILITIES
 
-In version 1.0, many utility methods are removed or deprecated, and
+In version 0.99, many utility methods are removed or deprecated, and
 most methods are made read-only.
 
 The following methods are deprecated: C<hostname>, C<url_scheme>,

Modified: branches/upstream/libplack-perl/current/lib/Plack/Response.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Response.pm?rev=70539&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Response.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Response.pm Sat Mar  5 22:28:56 2011
@@ -1,7 +1,7 @@
 package Plack::Response;
 use strict;
 use warnings;
-our $VERSION = '0.9973';
+our $VERSION = '0.9974';
 $VERSION = eval $VERSION;
 
 use Plack::Util::Accessor qw(body status);

Modified: branches/upstream/libplack-perl/current/lib/Plack/Server/ServerSimple.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Server/ServerSimple.pm?rev=70539&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Server/ServerSimple.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Server/ServerSimple.pm Sat Mar  5 22:28:56 2011
@@ -1,6 +1,6 @@
 package Plack::Server::ServerSimple;
 use strict;
-our $VERSION = '0.9973';
+our $VERSION = '0.9974';
 $VERSION = eval $VERSION;
 
 use parent qw(Plack::Handler::HTTP::Server::Simple);

Modified: branches/upstream/libplack-perl/current/lib/Plack/Test.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Test.pm?rev=70539&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Test.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Test.pm Sat Mar  5 22:28:56 2011
@@ -86,6 +86,17 @@
       my $res = $cb->(GET "/hello");
   };
 
+Note that however, it is not a good idea to pass an arbitrary
+(i.e. user-input) string to the C<GET> function or even C<<
+HTTP::Request->new >> by assuming that it always represents a path,
+because:
+
+  my $req = GET "//foo/bar";
+
+would represent a request for a URL that has no scheme, has a hostname
+I<foo> and a path I</bar>, instead of a path I<//foo/bar> which you
+might actually want.
+
 =back
 
 =head1 OPTIONS

Modified: branches/upstream/libplack-perl/current/lib/Plack/Test/Suite.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/lib/Plack/Test/Suite.pm?rev=70539&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/lib/Plack/Test/Suite.pm (original)
+++ branches/upstream/libplack-perl/current/lib/Plack/Test/Suite.pm Sat Mar  5 22:28:56 2011
@@ -763,6 +763,7 @@
             my $port = shift;
             my $app  = $class->test_app_handler;
             $server->($port, $app);
+            exit(0); # for Test::TCP
         },
         port => $server_port,
     );

Modified: branches/upstream/libplack-perl/current/t/HTTP-Server-PSGI/post.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/HTTP-Server-PSGI/post.t?rev=70539&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/HTTP-Server-PSGI/post.t (original)
+++ branches/upstream/libplack-perl/current/t/HTTP-Server-PSGI/post.t Sat Mar  5 22:28:56 2011
@@ -10,7 +10,7 @@
     server => sub {
         my $port = shift;
         my $runner = Plack::Runner->new;
-        $runner->parse_options("--port" => $port, "-E", "dev");
+        $runner->parse_options("--port" => $port, "-E", "dev", "-s", "HTTP::Server::PSGI");
         $runner->run(
             sub {
                 my $env = shift;

Modified: branches/upstream/libplack-perl/current/t/Plack-Loader/auto.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Loader/auto.t?rev=70539&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Loader/auto.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Loader/auto.t Sat Mar  5 22:28:56 2011
@@ -12,8 +12,7 @@
 $INC{"Plack/Handler/Twiggy.pm"} = __FILE__;
 sub Plack::Handler::Twiggy::new { bless {}, shift }
 
-# The following eval might not fail if you set PLACK_SEVER
-delete $ENV{PLACK_SERVER};
+local %ENV = ();
 
 eval {
     my $loader = Plack::Loader->new;

Modified: branches/upstream/libplack-perl/current/t/Plack-Middleware/chunked.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Middleware/chunked.t?rev=70539&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Middleware/chunked.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Middleware/chunked.t Sat Mar  5 22:28:56 2011
@@ -6,6 +6,8 @@
 use Plack::Test;
 use Plack::Middleware::Chunked;
 $Plack::Test::Impl = "Server";
+
+local %ENV = (); # use HTTP::Server::PSGI
 
 my @app = (
     sub { [ 200, [], [ 'Hello World' ] ] },

Modified: branches/upstream/libplack-perl/current/t/Plack-Middleware/component-leak.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Middleware/component-leak.t?rev=70539&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Middleware/component-leak.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Middleware/component-leak.t Sat Mar  5 22:28:56 2011
@@ -39,6 +39,7 @@
 use Plack::Test;
 use HTTP::Request::Common;
 $Plack::Test::Impl = "Server";
+local %ENV = (); # use HTTP::Server::PSGI
 
 my $app = MyComponent->new;
 test_psgi( $app->to_app, sub {

Added: branches/upstream/libplack-perl/current/t/Plack-Middleware/iis6_script_name_fix.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Middleware/iis6_script_name_fix.t?rev=70539&op=file
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Middleware/iis6_script_name_fix.t (added)
+++ branches/upstream/libplack-perl/current/t/Plack-Middleware/iis6_script_name_fix.t Sat Mar  5 22:28:56 2011
@@ -1,0 +1,68 @@
+use strict;
+use warnings;
+use Test::More;
+
+use Plack::Middleware::IIS6ScriptNameFix;
+
+my %env = (
+    'SCRIPT_NAME' => '/koo/blurb',
+    'PATH_INFO' => '/koo/blurb',
+    'HTTP_ACCEPT' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
+    'REQUEST_METHOD' => 'GET',
+    'SCRIPT_FILENAME' => 'C:\\Foo\\script\\blurb',
+    'INSTANCE_META_PATH' => '/LM/W3SVC/793536',
+    'SERVER_SOFTWARE' => 'Microsoft-IIS/6.0',
+    'AUTH_PASSWORD' => '',
+    'AUTH_TYPE' => '',
+    'HTTP_USER_AGENT' => 'Mozilla/5.0 (Windows; U; Windows NT 5.2; de; rv:1.9.0.4) Gecko/2008102920 Firefox/3.0.4 (.NET CLR 3.5.30729)',
+    'REMOTE_PORT' => '1281',
+    'QUERY_STRING' => '',
+    'URL' => '/koo/blurb',
+    'HTTP_ACCEPT_LANGUAGE' => 'de-de,de;q=0.8,en-us;q=0.5,en;q=0.3',
+    'FCGI_ROLE' => 'RESPONDER',
+    'HTTP_KEEP_ALIVE' => '300',
+    'CONTENT_TYPE' => '',
+    'LOCAL_ADDR' => '127.0.0.1',
+    'GATEWAY_INTERFACE' => 'CGI/1.1',
+    'HTTPS' => 'off',
+    'DOCUMENT_ROOT' => 'C:\\Foo\\script',
+    'REMOTE_HOST' => '127.0.0.1',
+    'PATH_TRANSLATED' => 'C:\\Foo\\script\\blurb',
+    'APPL_PHYSICAL_PATH' => 'C:\\Foo\\script\\',
+    'SERVER_NAME' => '127.0.0.1',
+    'HTTP_ACCEPT_ENCODING' => 'gzip,deflate',
+    'HTTP_CONNECTION' => 'keep-alive',
+    'INSTANCE_ID' => '793536',
+    'CONTENT_LENGTH' => '0',
+    'AUTH_USER' => '',
+    'APPL_MD_PATH' => '/LM/W3SVC/793536/Root/koo',
+    'HTTP_ACCEPT_CHARSET' => 'ISO-8859-1,utf-8;q=0.7,*;q=0.7',
+    'REMOTE_USER' => '',
+    'SERVER_PORT_SECURE' => '0',
+    'SERVER_PORT' => 83,
+    'REMOTE_ADDR' => '127.0.0.1',
+    'SERVER_PROTOCOL' => 'HTTP/1.1',
+    'REQUEST_URI' => '/koo/blurb',
+    'APP_POOL_ID' => 'DefaultAppPool',
+    'HTTP_HOST' => '127.0.0.1:83'
+);
+
+sub test_fix {
+    my ($input_env) = @_;
+
+    my $mangled_env;
+    Plack::Middleware::IIS6ScriptNameFix->wrap(sub {
+        my ($env) = @_;
+        $mangled_env = $env;
+        return [ 200, ['Content-Type' => 'text/plain'], [''] ];
+    })->($input_env);
+
+    return $mangled_env;
+}
+
+my $fixed_env = test_fix({ %env });
+
+is($fixed_env->{PATH_INFO}, '//blurb', 'check PATH_INFO');
+is($fixed_env->{SCRIPT_NAME}, '/koo', 'check SCRIPT_NAME');
+
+done_testing;

Modified: branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace/sigdie.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace/sigdie.t?rev=70539&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace/sigdie.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace/sigdie.t Sat Mar  5 22:28:56 2011
@@ -6,6 +6,7 @@
 use HTTP::Request::Common;
 
 $Plack::Test::Impl = "Server";
+local %ENV = (); # use HTTP::Server::PSGI
 
 my $app = sub {
     $SIG{__DIE__} = sub {};

Modified: branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace/utf8.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace/utf8.t?rev=70539&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace/utf8.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Middleware/stacktrace/utf8.t Sat Mar  5 22:28:56 2011
@@ -7,6 +7,8 @@
 use HTTP::Request::Common;
 
 $Plack::Test::Impl = "Server";
+local %ENV = (); # use HTTP::Server::PSGI
+
 my $app = Plack::Middleware::StackTrace->wrap(sub { die "Foo \x{30c6}" }, no_print_errors => 1);
 
 test_psgi $app, sub {

Modified: branches/upstream/libplack-perl/current/t/Plack-Middleware/urlmap_ports.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Middleware/urlmap_ports.t?rev=70539&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Middleware/urlmap_ports.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Middleware/urlmap_ports.t Sat Mar  5 22:28:56 2011
@@ -5,6 +5,7 @@
 use HTTP::Request::Common;
 
 $Plack::Test::Impl = "Server";
+local %ENV = (); # use HTTP::Server::PSGI
 
 my $make_app = sub {
     my $name = shift;

Modified: branches/upstream/libplack-perl/current/t/Plack-Middleware/wrapcgi.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Middleware/wrapcgi.t?rev=70539&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Middleware/wrapcgi.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Middleware/wrapcgi.t Sat Mar  5 22:28:56 2011
@@ -21,55 +21,4 @@
     is $res->content, "Hello bar counter=2";
 };
 
-{
-    my $tmp = File::Temp->new(CLEANUP => 1);
-    print $tmp <<"...";
-#!$^X
-use CGI;
-my \$q = CGI->new;
-print \$q->header, "Hello ", \$q->param('name'), " counter=", ++\$COUNTER;
-...
-    close $tmp;
-
-    chmod(oct("0700"), $tmp->filename) or die "Cannot chmod";
-
-    my $app_exec = Plack::App::WrapCGI->new(script => "$tmp", execute => 1)->to_app;
-    test_psgi app => $app_exec, client => sub {
-        my $cb = shift;
-
-        my $res = $cb->(GET "http://localhost/?name=foo");
-        is $res->code, 200;
-        is $res->content, "Hello foo counter=1";
-
-        $res = $cb->(POST "http://localhost/", ['name' => 'bar']);
-        is $res->code, 200;
-        is $res->content, "Hello bar counter=1";
-    };
-
-    undef $tmp;
-};
-
-{
-    my $tmp = File::Temp->new(CLEANUP => 1);
-    print $tmp <<"...";
-#!$^X
-use CGI;
-my \$q = CGI->new;
-print \$q->header, "Hello " x 10000;
-...
-    close $tmp;
-
-    chmod(oct("0700"), $tmp->filename) or die "Cannot chmod";
-
-    my $app_exec = Plack::App::WrapCGI->new(script => "$tmp", execute => 1)->to_app;
-    test_psgi app => $app_exec, client => sub {
-        my $cb = shift;
-
-        my $res = $cb->(GET "http://localhost/");
-        is $res->code, 200;
-    };
-
-    undef $tmp;
-};
-
 done_testing;

Added: branches/upstream/libplack-perl/current/t/Plack-Middleware/wrapcgi_exec.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Middleware/wrapcgi_exec.t?rev=70539&op=file
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Middleware/wrapcgi_exec.t (added)
+++ branches/upstream/libplack-perl/current/t/Plack-Middleware/wrapcgi_exec.t Sat Mar  5 22:28:56 2011
@@ -1,0 +1,64 @@
+use strict;
+use Test::More;
+use Test::Requires { 'CGI::Emulate::PSGI' => 0.06, 'CGI::Compile' => 0.03 };
+use Plack::Test;
+use HTTP::Request::Common;
+use Plack::App::WrapCGI;
+use IO::File;
+use File::Temp;
+
+plan skip_all => $^O if $^O eq "MSWin32";
+
+{
+    my $tmp = File::Temp->new(CLEANUP => 1);
+    print $tmp <<"...";
+#!$^X
+use CGI;
+my \$q = CGI->new;
+print \$q->header, "Hello ", \$q->param('name'), " counter=", ++\$COUNTER;
+...
+    close $tmp;
+
+    chmod(oct("0700"), $tmp->filename) or die "Cannot chmod";
+
+    my $app_exec = Plack::App::WrapCGI->new(script => "$tmp", execute => 1)->to_app;
+    test_psgi app => $app_exec, client => sub {
+        my $cb = shift;
+
+        my $res = $cb->(GET "http://localhost/?name=foo");
+        is $res->code, 200;
+        is $res->content, "Hello foo counter=1";
+
+        $res = $cb->(POST "http://localhost/", ['name' => 'bar']);
+        is $res->code, 200;
+        is $res->content, "Hello bar counter=1";
+    };
+
+    undef $tmp;
+};
+
+{
+    my $tmp = File::Temp->new(CLEANUP => 1);
+    print $tmp <<"...";
+#!$^X
+use CGI;
+my \$q = CGI->new;
+print \$q->header, "Hello " x 10000;
+...
+    close $tmp;
+
+    chmod(oct("0700"), $tmp->filename) or die "Cannot chmod";
+
+    my $app_exec = Plack::App::WrapCGI->new(script => "$tmp", execute => 1)->to_app;
+    test_psgi app => $app_exec, client => sub {
+        my $cb = shift;
+
+        my $res = $cb->(GET "http://localhost/");
+        is $res->code, 200;
+    };
+
+    undef $tmp;
+}
+
+done_testing;
+

Modified: branches/upstream/libplack-perl/current/t/Plack-Request/double_port.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Request/double_port.t?rev=70539&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Request/double_port.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Request/double_port.t Sat Mar  5 22:28:56 2011
@@ -4,6 +4,7 @@
 use HTTP::Request::Common;
 
 $Plack::Test::Impl = 'Server';
+local %ENV = (); # use HTTP::Server::PSGI
 
 my $app = sub {
     my $req = Plack::Request->new(shift);

Modified: branches/upstream/libplack-perl/current/t/Plack-Request/upload-large.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Request/upload-large.t?rev=70539&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Request/upload-large.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Request/upload-large.t Sat Mar  5 22:28:56 2011
@@ -9,6 +9,8 @@
 
 my @backends = qw( Server MockHTTP );
 sub flip_backend { $Plack::Test::Impl = shift @backends }
+
+local %ENV = (); # use HTTP::Server::PSGI
 
 my $app = sub {
     my $req = Plack::Request->new(shift);

Modified: branches/upstream/libplack-perl/current/t/Plack-Test/2args.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Test/2args.t?rev=70539&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Test/2args.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Test/2args.t Sat Mar  5 22:28:56 2011
@@ -2,6 +2,7 @@
 use Test::More;
 use HTTP::Request::Common;
 $Plack::Test::Impl = "Server";
+local %ENV = (); # use HTTP::Server::PSGI
 
 my $app = sub { return [ 200, [], [ "Hello" ] ] };
 

Modified: branches/upstream/libplack-perl/current/t/Plack-Test/hello_server.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libplack-perl/current/t/Plack-Test/hello_server.t?rev=70539&op=diff
==============================================================================
--- branches/upstream/libplack-perl/current/t/Plack-Test/hello_server.t (original)
+++ branches/upstream/libplack-perl/current/t/Plack-Test/hello_server.t Sat Mar  5 22:28:56 2011
@@ -2,6 +2,7 @@
 use Plack::Test;
 
 $Plack::Test::Impl = "Server";
+local %ENV = (); # use HTTP::Server::PSGI
 
 test_psgi
     client => sub {




More information about the Pkg-perl-cvs-commits mailing list