added tests for patterns