tests for PatternBuilder