add pattern matching tests