You've already forked json-iterator
mirror of
https://github.com/json-iterator/go.git
synced 2025-06-15 22:50:24 +02:00
#67 time as int64
This commit is contained in:
16
extra/time_as_int64_codec_test.go
Normal file
16
extra/time_as_int64_codec_test.go
Normal file
@ -0,0 +1,16 @@
|
||||
package extra
|
||||
|
||||
import (
|
||||
"testing"
|
||||
"time"
|
||||
"github.com/json-iterator/go/require"
|
||||
"github.com/json-iterator/go"
|
||||
)
|
||||
|
||||
func Test_time_as_int64(t *testing.T) {
|
||||
should := require.New(t)
|
||||
RegisterTimeAsInt64Codec()
|
||||
output, err := jsoniter.Marshal(time.Unix(1, 1002))
|
||||
should.Nil(err)
|
||||
should.Equal("1000001002", string(output))
|
||||
}
|
Reference in New Issue
Block a user