We have a fairly robust test-suite that covers all the corner cases we were able to find by trawling old/major Git repos, and then we have a Jenkins-powered server that does functional tests on a pile of major projects (Python, Ruby, PyPy, Vim, Git and Mercurial themselves, some other stuff I'm spacing) to make sure that what goes in also comes out. The test suite is kept tiny enough we can sanely run it locally; the functional test suite takes much longer, so it just runs in batches every hour or so, I believe. I'll double-check with QA and update this if I've got that off in any meaningful sense.