Skip to content

Commit 0485fc3

Browse files
committed
test: Add test for GroupByAppend without calling GroupBy
1 parent b326ee1 commit 0485fc3

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

exp/select_clauses_test.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,18 @@ func (scs *selectClausesSuite) TestGroupByAppend() {
405405
scs.Equal(exp.NewColumnListExpression(g, g2), c2.GroupBy())
406406
}
407407

408+
func (scs *selectClausesSuite) TestGroupByAppend_NoPreviousGroupBy() {
409+
g := exp.NewColumnListExpression(exp.NewIdentifierExpression("", "", "a"))
410+
g2 := exp.NewColumnListExpression(exp.NewIdentifierExpression("", "", "b"))
411+
412+
c := exp.NewSelectClauses().GroupByAppend(g)
413+
c2 := c.GroupByAppend(g2)
414+
415+
scs.Equal(g, c.GroupBy())
416+
417+
scs.Equal(exp.NewColumnListExpression(g, g2), c2.GroupBy())
418+
}
419+
408420
func (scs *selectClausesSuite) TestSetGroupBy() {
409421
g := exp.NewColumnListExpression(exp.NewIdentifierExpression("", "", "a"))
410422
g2 := exp.NewColumnListExpression(exp.NewIdentifierExpression("", "", "b"))

0 commit comments

Comments
 (0)