cvs commit: modperl-2.0/t/response/TestApache compat2.pm
stas2002/06/26 09:16:58 Modified:t/response/TestApache compat2.pm Log: add Apache-module compat tests Revision ChangesPath 1.19 +9 -1 modperl-2.0/t/response/TestApache/compat2.pm Index: compat2.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestApache/compat2.pm,v retrieving revision 1.18 retrieving revision 1.19 diff -u -r1.18 -r1.19 --- compat2.pm4 Jun 2002 13:04:47 - 1.18 +++ compat2.pm26 Jun 2002 16:16:58 - 1.19 -24,15 +24,23 sub handler { my $r = shift; -plan $r, tests = 48; +plan $r, tests = 50; $r-send_http_header('text/plain'); my $cfg = Apache::Test::config(); my $vars = $cfg-{vars}; +### Apache- tests my $fh = Apache-gensym; ok t_cmp('GLOB', ref($fh), Apache-gensym); + +ok t_cmp(1, Apache-module('mod_perl.c'), + Apache::module('mod_perl.c')); +ok t_cmp(0, Apache-module('mod_ne_exists.c'), + Apache::module('mod_ne_exists.c')); + +### $r- tests # test header_in and header_out # and err_header_out
cvs commit: modperl-2.0/t/response/TestApache compat2.pm
stas2002/06/04 06:04:47 Modified:t/response/TestAPI aplog.pm t/response/TestApache compat2.pm Log: add tests for 2 warn() aliases Revision ChangesPath 1.8 +3 -0 modperl-2.0/t/response/TestAPI/aplog.pm Index: aplog.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestAPI/aplog.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- aplog.pm 11 Apr 2002 11:08:43 - 1.7 +++ aplog.pm 4 Jun 2002 13:04:47 - 1.8 -62,6 +62,9 $s-loglevel(Apache::LOG_DEBUG); $slog-debug(sub { ok 1; $package test done }); +Apache-warn(Apache-warn test ok); +$s-warn('$s-warn test ok'); + Apache::OK; } 1.18 +1 -1 modperl-2.0/t/response/TestApache/compat2.pm Index: compat2.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestApache/compat2.pm,v retrieving revision 1.17 retrieving revision 1.18 diff -u -r1.17 -r1.18 --- compat2.pm4 Jun 2002 12:40:53 - 1.17 +++ compat2.pm4 Jun 2002 13:04:47 - 1.18 -247,7 +247,7 $r-post_connection(sub { OK }); -Apache::log_error(testing Apache::log_error); +Apache::log_error(Apache::log_error test ok); ok 1; OK;
cvs commit: modperl-2.0/t/response/TestApache compat2.pm
dougm 2002/06/03 11:27:03 Modified:lib/Apache compat.pm t/response/TestApache compat2.pm Log: add $r-is_main compat method Revision ChangesPath 1.59 +2 -0 modperl-2.0/lib/Apache/compat.pm Index: compat.pm === RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v retrieving revision 1.58 retrieving revision 1.59 diff -u -r1.58 -r1.59 --- compat.pm 3 Jun 2002 18:23:16 - 1.58 +++ compat.pm 3 Jun 2002 18:27:03 - 1.59 -321,6 +321,8 $r-send_fd_length($fh, -1); } +sub is_main { !shift-main } + package Apache::File; use Fcntl (); 1.15 +4 -1 modperl-2.0/t/response/TestApache/compat2.pm Index: compat2.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestApache/compat2.pm,v retrieving revision 1.14 retrieving revision 1.15 diff -u -r1.14 -r1.15 --- compat2.pm30 May 2002 04:05:06 - 1.14 +++ compat2.pm3 Jun 2002 18:27:03 - 1.15 -24,7 +24,7 sub handler { my $r = shift; -plan $r, tests = 45; +plan $r, tests = 46; $r-send_http_header('text/plain'); -230,6 +230,9 my $t_class = ref $t; ok t_cmp('APR::Table', $t_class, Apache::Table-new); + +ok t_cmp(!$r-main, $r-is_main, + '$r-is_main'); #note these are not actually part of the tests #since i think on platforms where crypt is not supported,
cvs commit: modperl-2.0/t/response/TestApache compat2.pm
dougm 02/05/29 21:05:07 Modified:lib/Apache compat.pm t/response/TestApache compat2.pm Log: add compat for Apache::Table-new Revision ChangesPath 1.57 +8 -0 modperl-2.0/lib/Apache/compat.pm Index: compat.pm === RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v retrieving revision 1.56 retrieving revision 1.57 diff -u -r1.56 -r1.57 --- compat.pm 30 May 2002 03:54:08 - 1.56 +++ compat.pm 30 May 2002 04:05:06 - 1.57 -472,5 +472,13 APR::URI-parse($r-pool, $uri); } +package Apache::Table; + +sub new { +my($class, $r, $nelts) = _; +$nelts ||= 10; +APR::Table::make($r-pool, $nelts); +} + 1; __END__ 1.14 +6 -1 modperl-2.0/t/response/TestApache/compat2.pm Index: compat2.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestApache/compat2.pm,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- compat2.pm25 May 2002 17:49:03 - 1.13 +++ compat2.pm30 May 2002 04:05:06 - 1.14 -24,7 +24,7 sub handler { my $r = shift; -plan $r, tests = 44; +plan $r, tests = 45; $r-send_http_header('text/plain'); -225,6 +225,11 my $ptime = Apache::Util::parsedate($fmtdate); ok t_cmp($time, $ptime, Apache::Util::parsedate); + +my $t = Apache::Table-new($r); +my $t_class = ref $t; + +ok t_cmp('APR::Table', $t_class, Apache::Table-new); #note these are not actually part of the tests #since i think on platforms where crypt is not supported,
cvs commit: modperl-2.0/t/response/TestApache compat2.pm
dougm 02/05/24 09:58:42 Modified:lib/Apache compat.pm t/response/TestApache compat2.pm Log: add Apache::Util::escape_uri compat function and tests Revision ChangesPath 1.50 +7 -0 modperl-2.0/lib/Apache/compat.pm Index: compat.pm === RCS file: /home/cvs/modperl-2.0/lib/Apache/compat.pm,v retrieving revision 1.49 retrieving revision 1.50 diff -u -r1.49 -r1.50 --- compat.pm 24 May 2002 16:49:29 - 1.49 +++ compat.pm 24 May 2002 16:58:41 - 1.50 -26,6 +26,7 use Apache::RequestIO (); use Apache::RequestUtil (); use Apache::Response (); +use Apache::Util (); use Apache::Log (); use Apache::URI (); use APR::Table (); -414,6 +415,12 } *unescape_uri = \Apache::unescape_url; + +sub escape_uri { +my $path = shift; +my $r = Apache::compat::request('Apache::Util::escape_uri'); +Apache::Util::escape_path($path, $r-pool); +} sub Apache::URI::parse { my($class, $r, $uri) = _; 1.8 +9 -2 modperl-2.0/t/response/TestApache/compat2.pm Index: compat2.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestApache/compat2.pm,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- compat2.pm19 May 2002 11:41:53 - 1.7 +++ compat2.pm24 May 2002 16:58:42 - 1.8 -24,7 +24,7 sub handler { my $r = shift; -plan $r, tests = 39; +plan $r, tests = 41; $r-send_http_header('text/plain'); -192,8 +192,15 } } -my $uri = http://foo.com/a%20file.html;; +my $uri = http://foo.com/a file.html; +(my $esc_uri = $uri) =~ s/ /\%20/g; my $uri2 = $uri; + +$uri = Apache::Util::escape_uri($uri); +$uri2 = Apache::Util::escape_path($uri2, $r-pool); + +ok t_cmp($esc_uri, $uri, Apache::Util::escape_uri); +ok t_cmp($esc_uri, $uri2, Apache::Util::escape_path); ok t_cmp(Apache::unescape_url($uri), Apache::Util::unescape_uri($uri2),
cvs commit: modperl-2.0/t/response/TestApache compat2.pm
dougm 02/04/07 14:41:33 Modified:t/response/TestApache compat2.pm Log: needs adjustment after fix to Apache::compat Revision ChangesPath 1.4 +1 -1 modperl-2.0/t/response/TestApache/compat2.pm Index: compat2.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestApache/compat2.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- compat2.pm7 Apr 2002 01:25:14 - 1.3 +++ compat2.pm7 Apr 2002 21:41:33 - 1.4 -18,7 +18,7 42 =1k, 42_000 = 41k, 42_000_000 = 40.1M, -42_000_000_000 = 40054.3M, +42_000_000_000 = 40054M, ); sub handler {
cvs commit: modperl-2.0/t/response/TestApache compat2.pm
dougm 02/04/06 17:25:14 Modified:t/response/TestApache compat2.pm Log: get rid of annoying unexpectedly succeeded messages: apache/compat2..ok, 1/34 unexpectedly succeeded All tests successful (1 subtest UNEXPECTEDLY SUCCEEDED). Revision ChangesPath 1.3 +5 -5 modperl-2.0/t/response/TestApache/compat2.pm Index: compat2.pm === RCS file: /home/cvs/modperl-2.0/t/response/TestApache/compat2.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- compat2.pm29 Jan 2002 07:55:56 - 1.2 +++ compat2.pm7 Apr 2002 01:25:14 - 1.3 -24,7 +24,7 sub handler { my $r = shift; -plan $r, tests = 34, todo = [23]; +plan $r, tests = 33; $r-send_http_header('text/plain'); -152,11 +152,11 $r-headers_out-{Content-length}, \$r-set_content_length($csize) w/ setting explicit size); -$r-set_content_length(); +#$r-set_content_length(); # TODO -ok t_cmp(0, # XXX: $r-finfo-csize is not available yet - $r-headers_out-{Content-length}, - \$r-set_content_length() w/o setting explicit size); +#ok t_cmp(0, # XXX: $r-finfo-csize is not available yet +# $r-headers_out-{Content-length}, +# \$r-set_content_length() w/o setting explicit size); # XXX: how to test etag? t_debug \$r-set_etag;