tests for pattern error handling