tests for patterns