added record patterns and list patterns in cases, and tests