httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Randy Kobes <ra...@theoryx5.uwinnipeg.ca>
Subject env/t/request.t on Win32
Date Fri, 06 Aug 2004 03:21:15 GMT
There's a couple of things about the env/t/request.t test
that Win32 doesn't handle:
- link() isn't available;
- when comparing the output from the redirect tests
involving index.txt, there's a \r that needs to be taken
into account.
This patch allows the tests to pass on Win32:
====================================================
Index: env/t/request.t
===================================================================
RCS file: /home/cvs/httpd-apreq-2/env/t/request.t,v
retrieving revision 1.12
diff -u -r1.12 request.t
--- env/t/request.t	3 Aug 2004 05:06:04 -0000	1.12
+++ env/t/request.t	6 Aug 2004 03:14:13 -0000
@@ -62,14 +62,19 @@
 # internal redirect to plain text files (which are non-apreq requests)

 my $index_html = do {local (@ARGV,$/) = "t/htdocs/index.html"; <> };
-link "t/htdocs/index.html", "t/htdocs/index.txt";
-ok t_cmp(GET_BODY("/apreq_redirect_test?test=redirect_index_txt_GET&location=/index.txt"),
$index_html,
-        "redirect /index.txt (GET)");
+require File::Copy;
+File::Copy::copy("t/htdocs/index.html", "t/htdocs/index.txt")
+    or die "Cannot copy t/htdocs/index.html to t/htdocs/index.txt: $!";

-ok t_cmp(POST_BODY("/apreq_redirect_test?test=redirect_index_txt_POST",
-        content => "quux=$filler;location=/index.txt;foo=$filler"), $index_html,
+$body = GET_BODY("/apreq_redirect_test?test=redirect_index_txt_GET&location=/index.txt");
+$body =~ s{\r}{}g;
+ok t_cmp($body, $index_html,
+        "redirect /index.txt (GET)");
+$body = POST_BODY("/apreq_redirect_test?test=redirect_index_txt_POST",
+        content => "quux=$filler;location=/index.txt;foo=$filler");
+$body =~ s{\r}{}g;
+ok t_cmp($body, $index_html,
         "redirect /index.txt (POST)");
-

 # output filter tests

=====================================================

I was wondering, in particular, if the copying of the
file, rather than using link, affects the test?

-- 
best regards,
randy

Mime
View raw message