completed pattern matching test program