[antlr-interest] Slight mismatch between real and expected gunit results

Jasper Floor jasperfloor at gmail.com
Fri Jun 18 07:00:48 PDT 2010


I have used ANTLR to create a small DSL for my company. I wanted to
implement tests for the grammar with gunit (which I only just
discovered). I ran the example and it works wonderfully but there is
one slight problem with the output.

On the wiki you can see the expected output of gunit. The output I get
is almost identical except that escape codes in Strings are not
interpreted.

As can be seen below the output is correct but the strings contain \n
instead of eol characters.

I don't know if this happens in gunit or in the generated Parser but I
suspect gunit or something I did.

I am working with ANTLR 3.2, Ubuntu 10.4 and java 6 update 20.

mvg,
Jasper Floor

my output:
-----------------------------------------------------------------------
executing testsuite for grammar:SimpleC with 11 tests
-----------------------------------------------------------------------
4 failures found:
test2 (variable, line7) -
expected: x
actual: null

test3 (functionHeader, line11) -
expected: int
actual: bar

test6 (program, line22) -
expected:
actual: bar is a declaration\nfoo is a definition\n

test8 (ID, line28) -
expected: OK
actual: extra text found, '@999'


Tests run: 11, Failures: 4


More information about the antlr-interest mailing list