You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
452 B
Go
38 lines
452 B
Go
package jsonm
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
type B struct {
|
|
B string `json:"b"`
|
|
}
|
|
|
|
func TestUnmarshal(t *testing.T) {
|
|
var c *B
|
|
|
|
b, _ := Marshal(c)
|
|
|
|
t.Log(b == nil)
|
|
t.Log(b == nil)
|
|
|
|
}
|
|
|
|
func TestMarshalCkNil(t *testing.T) {
|
|
var c int64
|
|
|
|
t.Run("Marshal", func(t *testing.T) {
|
|
b, _ := Marshal(c)
|
|
t.Log(b == nil)
|
|
t.Log(b == nil)
|
|
})
|
|
|
|
t.Run("MarshalCkZero", func(t *testing.T) {
|
|
|
|
b, _ := MarshalCkZero(c)
|
|
t.Log(b == nil)
|
|
t.Log(b == nil)
|
|
})
|
|
|
|
}
|