3

I'm developing an RFC 2822 address parser (not a validator), and was wondering if anyone knew of a good list of test cases that exercises corner cases that might crop up? The specification of the address format is quite complex, and I'm not convinced I understand it fully enough to be certain of identifying all of the odd cases that could crop up.

For the sake of clarity, I'm talking about addresses as they might appear in header lines, so stuff like comments in odd places is the kind of issue I'm thinking about.

Jules
  • 14,841
  • 9
  • 83
  • 130

2 Answers2

5

I found this during my quest for the same:

http://isemail.info/_system/is_email/test/?all

Hope this helps.

Aman Deep Gautam
  • 8,091
  • 21
  • 74
  • 130
  • The link used to reveal a good number of test cases, IIRC, but now simply seems to return a verdict for `_system/is_email/test/?all` which it (thankfully!) thinks is an invalid email address. [The source on Github](https://github.com/dominicsayers/isemail) still contains a list of [test cases in XML.](https://github.com/dominicsayers/isemail/blob/master/test/tests.xml) – tripleee Jan 22 '19 at 05:26
1

I had found a blog post over on the MSDN blogs that provides a few test cases specific to RFC2822. I'm not certain it is the definitive list of test cases, but it might be a good starting point.

Email Address test cases

Justin Pearce
  • 4,994
  • 2
  • 24
  • 37
  • 1
    It's certainly a start, and I've also picked up a couple of others from validation libraries that have unit tests, but unfortunately none of these cover either the personal name field or the possibility of embedded comments. – Jules Apr 05 '13 at 19:11