Add to define pattern test

- Fix bug