Add tests for patch validation

Addresses #11