Verify that a version specification matches a version string.