Test Cases
Posted Apr 17, 2003 23:58 UTC (Thu) by
AnswerGuy (guest, #1256)
Parent article:
Kodos: A Python Regular Expressions Tool
I haven't tried this tool, but from the description their is a box for
entering test strings. That's find and dandy for interactive use but
I've found that you really want to have your regexp test cases stored
in a file (preferably a largish sample of the typical text that this
program is supposed to encounter.
Way back in my awk programming days I found it handy to write small
stubs of awk code that simply desplayed regexp matches from my test
case file. Actually having two test case files make sense --- one
that contains nothing but cases that should match and the other such
that there should be NO matches.
So, perhaps we should send the author a patch that implements these
features --- in the form of two buttons:
Test Cases: [Run] [Configure]
Configure would allow one to point to one or two text files (for
"match all" and "match none" (and optionally allow cases to be added
to or removed from either of them).
Run would just run the current regexp against all the test cases
and show any failures.
This feature would promote one of the best practices from eXtreme
Programming --- create test suites and harnesses before coding.
JimD
(
Log in to post comments)