ralsina at kde
Mar 4, 2007, 7:26 AM
Post #3 of 3
On Sat 03 Mar 2007 22:50:18 Stuart D. Gathman wrote:
> On Sat, 3 Mar 2007, Roberto Alsina wrote:
> > Anyone knows where I can find a nice, simple, C implementation of this
> > validation? Or at least one without regexps? If I get that, RASPF should
> > pass 142 of the 145 tests...
> No specific code, but...
> If I were doing it in C, I would start with the ABNF in 4408 for such
> validations, not PySPF. In some cases, the ABNF can be mirrored with
> recursive evaluation (limit string length to limit max recursion), in
> others you'll need a state machine (which regex libraries do for you
I'll check that. I am not sure I am up to it. And in Python it's a
three-liner, there must be a way :-)
> Use a C unit testing framework that tests internal parts such as this. I
> use check [http://check.sourceforge.net/].
I am already using it. In fact, without check and the nice unit testing in
PySPF, I would never have been able to get this far. It's nice knowing when
what you do actually works, and if it breaks.
This project has made me a unit testing believer out of me!
> Specific code - how did libspf2 do it? (Or did they?)
I can't say I found it.
("\''/").__..-''"`-. . Roberto Alsina
`9_ 9 ) `-. ( ).`-._.`) ralsina [at] kde
(_Y_.)' ._ ) `._`. " -.-' KDE Developer (MFCH)
(l)-'' ((i).' ((!.' Buenos Aires - Argentina
Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it. --Brian W. Kernighan
To unsubscribe, change your address, or temporarily deactivate your subscription,
please go to http://v2.listbox.com/member/?list_id=1007