vercmp: Add tests and a bunch of error checking