Add tests for patch validation - #11
Merge from patch_validation branch