Skip to content

Commit

Permalink
add timestamp test
Browse files Browse the repository at this point in the history
  • Loading branch information
acoshift committed Dec 21, 2022
1 parent a1f8cbb commit 3c054d1
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion pgstmt/update_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package pgstmt_test

import (
"testing"
"time"

"github.com/stretchr/testify/assert"

Expand Down Expand Up @@ -89,6 +90,7 @@ func TestUpdate(t *testing.T) {
b.Set("name").ToRaw("p.name")
b.Set("address").ToRaw("p.address")
b.Set("updated_at").ToRaw("now()")
b.Set("date").To(pgstmt.NotArg(time.Date(2022, 1, 2, 3, 4, 5, 6, time.UTC)))
b.From("users")
b.InnerJoin("profiles p").Using("email")
b.Where(func(b pgstmt.Cond) {
Expand All @@ -101,7 +103,8 @@ func TestUpdate(t *testing.T) {
update users
set name = p.name,
address = p.address,
updated_at = now()
updated_at = now(),
date = '2022-01-02 03:04:05.000000006Z'
from users
inner join profiles p using (email)
where (users.id = $1)
Expand Down

0 comments on commit 3c054d1

Please sign in to comment.