Add tests for pattern searching