add test for __flatten_patterns_tree__