[antlr-interest] gUnit 1.0.2 updated

Mark Volkmann r.mark.volkmann at gmail.com
Sat Feb 9 03:17:36 PST 2008


On Feb 8, 2008 10:34 PM, Leon Su <leon.antlr at mac.com> wrote:
> Hi Mark,
>
> Thanks for pointing out this. When testing a start rule (output=AST),
> gUnit will
> get the nil node generated from ANTLR which represents a list of
> subtrees.
> The outermost parentheses are not displayed currently.
> I'll add this to the next release. Sorry for the inconvenience.

No problem. So that means that even though I don't see the outer
parens, gUnit knows they are there. Why then do I get this output
indicating a test failure? It seems the actual output matches the
expected.

expected: ((= a 19) (list variables))
actual:
  (= a 19) (list variables)

Something is suspicious about the whitespace between "actual:" and the
first "(". There is a newline and two spaces.

Let me know if you'd like the files for my grammar and my test.

> On Feb 8, 2008, at 6:40 PM, Mark Volkmann wrote:
>
> > On Feb 8, 2008 6:28 PM, Leon Su <leon.antlr at mac.com> wrote:
> >> Hi,
> >>
> >> gUnit 1.0.2 is available on the wiki (attachment page):
> >> http://www.antlr.org/wiki/display/ANTLR3/gUnit+-+Grammar+Unit+Testing
> >> It's compatible with the latest antlr-2008-01-23.10.
> >
> > Thank you so much Leon! I've been waiting for this.
> >
> > Is there a trick to testing the start rule which generates the topmost
> > AST containing the nil root element supplied by ANTLR?
> >
> > Here's the rule I'm testing.
> >
> > script: NEWLINE? statement*;
> >
> > statement is a rule that ends in terminator.
> > terminator can be a NEWLINE or EOF.
> >
> > Here's the test that isn't working.
> >
> > script:
> > <<
> > a = 19
> > list variables
> >>> -> ((= a 19) (list variables))
> >
> > I get the following output.
> >
> > 1 failures found:
> > test13 (script) -
> > expected: ((= a 19) (list variables))
> > actual:
> >  (= a 19) (list variables)
> >
> > --
> > R. Mark Volkmann
> > Object Computing, Inc.
>
>



-- 
R. Mark Volkmann
Object Computing, Inc.


More information about the antlr-interest mailing list