What is you parser supposed to parse?
If it's some kind of programming language and there is already another
parser doing what you want (but maybe not written in JavaScript), you
could get codes from Google Code and then send it to the two parsers
and check whether both return the same value or not.

On Thu, Oct 6, 2011 at 6:32 PM, Bemi Faison <[email protected]> wrote:
> I was writing unit tests for a parser when I realized that the task was
> larger than anticipated. Since the test must ensure my parser can properly
> distinguish text patterns, I'm worried that the one pattern it fails won't
> be included.
> Then, I thought of those early pre-press applications, like Quark, which
> could inject random text (see "greek" or "Lorem Ipsum") into a page layout.
> I think they called such text Jabberwocky - or maybe that was the name of a
> plugin... I digress.
> What's a good way to throw these kinds of garbage/random strings at a
> parser, to ensure the parser doesn't fail? Any examples of a test that used
> the parsing rules against the parser? Is there a simple pattern for doing
> this? More over, in case I'm reinventing the wheel, is there a tiny (tiny)
> library for parsing text?
>
> --
> To view archived discussions from the original JSMentors Mailman list:
> http://www.mail-archive.com/[email protected]/
>
> To search via a non-Google archive, visit here:
> http://www.mail-archive.com/[email protected]/
>
> To unsubscribe from this group, send email to
> [email protected]
>

-- 
To view archived discussions from the original JSMentors Mailman list: 
http://www.mail-archive.com/[email protected]/

To search via a non-Google archive, visit here: 
http://www.mail-archive.com/[email protected]/

To unsubscribe from this group, send email to
[email protected]

Reply via email to