feat: refine pattern selection and fix test
2 files changed