unit tests for query balanced parens