FAQ
I'm writing an online-parser, and by online I mean one that can
incrementally parse new input without starting over.

It is also a generalized parser, which means that it will produce all
possible parse-trees for ambiguous grammars.

The output of the parser is a channel of parse trees, some accepted
(valid/successful), others rejected (invalid/not matched).

Now I'm at the stage where the parser will become concurrent and hence the
order of parse trees produced is no longer deterministic.

How could I go about unit-testing this? Does it even make sense to
unit-test it?

--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Search Discussions

  • Egon at Dec 5, 2014 at 2:41 pm

    On Friday, 5 December 2014 15:43:08 UTC+2, tomwilde wrote:
    I'm writing an online-parser, and by online I mean one that can
    incrementally parse new input without starting over.

    It is also a generalized parser, which means that it will produce all
    possible parse-trees for ambiguous grammars.

    The output of the parser is a channel of parse trees, some accepted
    (valid/successful), others rejected (invalid/not matched).

    Now I'm at the stage where the parser will become concurrent and hence the
    order of parse trees produced is no longer deterministic.

    How could I go about unit-testing this? Does it even make sense to
    unit-test it?
    I don't completely understand it, but it sounds like something for
    generated tests:

    http://golang.org/pkg/testing/quick/

    https://vimeo.com/17135313
    https://vimeo.com/68383317
    https://vimeo.com/68331689

    + Egon

    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.
  • Steve McCoy at Dec 8, 2014 at 1:46 pm
    Are you saying that your main problem is comparing the returned parse trees
    with known values in your tests? My first guess would be to put your
    results into a slice and sort them somehow; then the ordering will be
    deterministic. It could still be a pain to write if the results for
    ambiguous grammars are huge.

    On Friday, December 5, 2014 8:43:08 AM UTC-5, tomwilde wrote:

    I'm writing an online-parser, and by online I mean one that can
    incrementally parse new input without starting over.

    It is also a generalized parser, which means that it will produce all
    possible parse-trees for ambiguous grammars.

    The output of the parser is a channel of parse trees, some accepted
    (valid/successful), others rejected (invalid/not matched).

    Now I'm at the stage where the parser will become concurrent and hence the
    order of parse trees produced is no longer deterministic.

    How could I go about unit-testing this? Does it even make sense to
    unit-test it?
    --
    You received this message because you are subscribed to the Google Groups "golang-nuts" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe@googlegroups.com.
    For more options, visit https://groups.google.com/d/optout.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedDec 5, '14 at 1:43p
activeDec 8, '14 at 1:46p
posts3
users3
websitegolang.org

3 users in discussion

Egon: 1 post Steve McCoy: 1 post Tomwilde: 1 post

People

Translate

site design / logo © 2022 Grokbase