Skip to content

Commit

Permalink
fix: test failed on other timezone.(#3181) (#3183)
Browse files Browse the repository at this point in the history
  • Loading branch information
kvii authored Feb 2, 2024
1 parent a556a2b commit d9f390c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions encoding/form/form_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/base64"
"reflect"
"testing"
"time"

"google.golang.org/protobuf/types/known/durationpb"
"google.golang.org/protobuf/types/known/fieldmaskpb"
Expand Down Expand Up @@ -86,6 +87,10 @@ func TestFormCodecUnmarshal(t *testing.T) {
}

func TestProtoEncodeDecode(t *testing.T) {
loc := time.Local
time.Local = time.UTC
t.Cleanup(func() { time.Local = loc })

in := &complex.Complex{
Id: 2233,
NoOne: "2233",
Expand Down
5 changes: 5 additions & 0 deletions encoding/form/proto_encode_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package form

import (
"testing"
"time"

"google.golang.org/protobuf/types/known/durationpb"
"google.golang.org/protobuf/types/known/fieldmaskpb"
Expand All @@ -12,6 +13,10 @@ import (
)

func TestEncodeValues(t *testing.T) {
loc := time.Local
time.Local = time.UTC
t.Cleanup(func() { time.Local = loc })

in := &complex.Complex{
Id: 2233,
NoOne: "2233",
Expand Down

0 comments on commit d9f390c

Please sign in to comment.