Skip to content

Commit

Permalink
Add automated tests for multiple selects
Browse files Browse the repository at this point in the history
  • Loading branch information
fairking committed Apr 18, 2024
1 parent 15bdbd6 commit 08ae153
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions builder/query_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ func TestQuery_Build(t *testing.T) {
result: "SELECT `users`.* FROM `users` FOR UPDATE;",
query: rel.From("users").Lock("FOR UPDATE"),
},
{
result: "SELECT `id`,`name` FROM `contacts`;",
query: rel.Select("id").Select("name").From("contacts"),
},
}

for _, test := range tests {
Expand Down Expand Up @@ -185,6 +189,10 @@ func TestQuery_Build_ordinal(t *testing.T) {
result: "SELECT \"users\".* FROM \"users\" FOR UPDATE;",
query: rel.From("users").Lock("FOR UPDATE"),
},
{
result: "SELECT \"id\",\"name\" FROM \"contacts\";",
query: rel.Select("id", "name").From("contacts"),
},
}

for _, test := range tests {
Expand Down

0 comments on commit 08ae153

Please sign in to comment.