jnthn / grammar-debugger

Grammar::Debugger and Grammer::Tracer Perl 6 modules
36 stars 20 forks source link

fix (superset of) #5, add REAL tests, consolidate Tracer&Debugger, prep proper handling of state #7

Open meisl opened 10 years ago

meisl commented 10 years ago

Oh, quite a bunch of things...

First of all: this thing really deserves being pushed beyond a mere demonstration piece, IMHO. So that's what I'm trying here (and, on the way, learning; which is my humble benefit in it).

So, the one essential thing I needed to have in order to start moving things around - was tests. I mean REAL tests, not just the pseudo ones that were there. Well, testing an interactive thing like Debugger requires a bit more than ok and is. So I put together RemoteControl in Grammar::Test::Helper, which is kind of a robot that exercises Tracer/Debugger and logs what they write to STDOUT and STDERR. Then there's another test helper &parseTasks to help with easily running a bunch of tests on all kinds of triggering a parse: (parse, subparse, parsefile) X (invoked on class, invoked on instance)[1]. Of course there are tests for the test-helpers themselves as well. So these test-helpers plus the actual tests that use them are the first chief contribution in this pr. They can - and should be - further improved, though.

Anyways, thus being able to "move things around" safely, I think I've considerably consolidated things:


[1] as I now have learned "on class" vs "on instance" doesn't really matter at all. But well, to be sure - plus there was a (real!) issue re that (#4)... [2] anyone to actually compare the pure LOC...?