Add tests for patch()