tests for pattern error handling
fixes #12