Skip to content

Commit

Permalink
test: Add test for GroupByAppend without calling GroupBy
Browse files Browse the repository at this point in the history
  • Loading branch information
doug-martin committed Jul 27, 2021
1 parent b326ee1 commit 0485fc3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions exp/select_clauses_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,18 @@ func (scs *selectClausesSuite) TestGroupByAppend() {
scs.Equal(exp.NewColumnListExpression(g, g2), c2.GroupBy())
}

func (scs *selectClausesSuite) TestGroupByAppend_NoPreviousGroupBy() {
g := exp.NewColumnListExpression(exp.NewIdentifierExpression("", "", "a"))
g2 := exp.NewColumnListExpression(exp.NewIdentifierExpression("", "", "b"))

c := exp.NewSelectClauses().GroupByAppend(g)
c2 := c.GroupByAppend(g2)

scs.Equal(g, c.GroupBy())

scs.Equal(exp.NewColumnListExpression(g, g2), c2.GroupBy())
}

func (scs *selectClausesSuite) TestSetGroupBy() {
g := exp.NewColumnListExpression(exp.NewIdentifierExpression("", "", "a"))
g2 := exp.NewColumnListExpression(exp.NewIdentifierExpression("", "", "b"))
Expand Down

0 comments on commit 0485fc3

Please sign in to comment.