add a test pattern function