unit-testingurlparsingstandards-compliancerfc3986

URL parsing test suite


I need to test some existing http:// URL parsing code for compliance to RFC 3986.

I do not want to reinvent the wheel and to bump in to various corner cases.

Is there some existing comprehensive test suite for that?

I do not specify the language I use since I expect the test suite to be generic enough to be adaptable. I would settle for anything sane though.


Solution

  • The Addressable Ruby library has a very comprehensive Spec Suite (618 examples with 800 expectations in 123 example groups, weighing in at over 3700 SLOC), which covers large parts of RfC3986. The code is here. I'm not sure how directly you can run this on your library, maybe you can get it working unmodified, by writing a simple API-compatible Ruby-wrapper for your library? Otherwise, the Spec is really well patterned, so you should be able to get pretty far with some simple Rename Method Refactorings and Regexp-fu.