Pattern matching tests