Added new tests for refactored patch subsystem