> 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.

great!

> + > 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.

ok

> + 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):

my mistake, I was referring to another post with patches that I've sent at
the same time: for expires.t. Do you know who's the "owner" of this test?
I guess I should just check cvs log :0

> 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?

yup, but better written as:

  $r =~ /^\d+$/

you don't need [] and this allows you to accomodate numbers with more than
one digit in the future, again without changing the code.

> 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...

I suppose that if the base is there, other people can jump in and add more
tests.

Especially important to make sure that those who code the modules know
about the existance of this project and the best way to proceed is to do
the following:

- every time a bug gets reported, before you even attempt the fix, write a
test that exposes the bug.
- now fix the bug and make sure that test passes ok.
- it's possible that a few tests can be written to expose the same bug.

Now if anybody with the high httpd karma could let others know about this
magic scenario, that would help the test writers a lot.

> + 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...

cool, thanks!


_____________________________________________________________________
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/




Reply via email to