On Wed, Aug 08, 2001 at 10:28:24AM +0800, Stas Bekman wrote:
+
+ OK, so why not to do: /^[1-6]$/ ?
this wouldnt test for the right thing.
+
+ I'd do it even more flexible:
+
+ my $pat = join '', @num;
+ /^[$pat]$/
+
+ so now you can change @num and not to worry about forgetting adjusting the
+ code.
this, however, is a good idea...i think i will use this.
+
+ > as a side note, i think you're getting this error because your
+ > particular build of apache does not contain mod_rewrite. very soon,
+ > the test will tell you its not going to run on your platform...heh.
+ > i plan to talk to doug about this today.
+
+ Well, I did enable rewrite, see my original post. But I was running httpd
+ 2.0, so may be it's not the same.
yeah i missed that you did build it in there, sorry bout that. i had the same
problems with --enable-rewite=shared. i build static and some of the tests
passed. it wouldnt let me start up with the current config because it said i
didnt have NDBM support, but doug tells me thats because mod_rewrite.c is
trying to execute some non-existant script...so thats a bug...probably just a
packaging issue.
+
+ In any case, your code was good, but it'd didn't do initializations in
+ every place it should and didn't check for whether variables are defined
+ before using them. Something that's not acceptible with warnings mode that
+ you use. You didn't see any problems because the test has been completely
+ working for you, but if something goes wrong (which is what the test is
+ designed for) it was immediately dying without proceeding, on the first
+ warning, because warnings are fatal.
+
+ Please consider using parts of my patch, at least those parts where I've
+ added various initializations and checks. I guess you should try to
+ compile httpd with no mod_rewrite and see how it fails. Which can be a
+ case if it doesn't work properly.
i dont know where the missing initializations are that you are talking about...
perhaps we are talking about another patch that im not seeing at the moment.
here is what i have (minus indentation fixes):
Index: t/modules/rewrite.t
===================================================================
RCS file: /home/cvs/httpd-test/perl-framework/t/modules/rewrite.t,v
retrieving revision 1.1
diff -u -r1.1 rewrite.t
--- t/modules/rewrite.t 2001/08/02 16:38:19 1.1
+++ t/modules/rewrite.t 2001/08/07 05:54:43
@@ -25,7 +25,7 @@
chomp $r;
if ($_ eq 'RND') {
- ok ($r =~ /^[$r-6]$/);
+ ok ($r =~ /^[$r\-6]$/);
} else {
ok ($r eq $n);
}
so i dont see the initializations you are talking about. but if i am missing
initializations somewhere, i certainly want to know about it. i checked in a
small sanity check on $r yesterday, have you seen that?
also, i realize that this rewrite test is very minimal compared to the
functionality of mod_rewrite. i kinda quit working on it in the middle of it
because 1) i could spend the rest of eternity writing testcases for every
possibility in mod_rewrite and 2) i wanted to get some work done on writing
test for other modules. so, this test may not be very refined because when i
finally came to this conclusion, i just checked in what i had at the moment
just so it wouldnt be lost...
+
+ Also it'd be nice that we all follow the same ident style, which is 4
+ spaces (no tabs!) in the Perl code. thanks :)
doh! sorry! didnt know... i will do this from now on. will gradually fix the
ones in the repository...
+
+ _____________________________________________________________________
+ Stas Bekman JAm_pH -- Just Another mod_perl Hacker
+ http://stason.org/ mod_perl Guide http://perl.apache.org/guide
+ mailto:[EMAIL PROTECTED] http://apachetoday.com http://eXtropia.com/
+ http://singlesheaven.com http://perl.apache.org http://perlmonth.com/
+
+
-j