mirror of
https://github.com/netbirdio/easyjson.git
synced 2026-05-22 18:44:42 -07:00
We now include and pass tests
Signed-off-by: Levi Gross <levi@levigross.com>
This commit is contained in:
+2
-2
@@ -48,8 +48,8 @@ var primitiveStringDecoders = map[reflect.Kind]string{
|
||||
reflect.Uint32: "in.Uint32Str()",
|
||||
reflect.Uint64: "in.Uint64Str()",
|
||||
reflect.Uintptr: "in.UintptrStr()",
|
||||
reflect.Float32: "in.Float32()Str",
|
||||
reflect.Float64: "in.Float64()Str",
|
||||
reflect.Float32: "in.Float32Str()",
|
||||
reflect.Float64: "in.Float64Str()",
|
||||
}
|
||||
|
||||
var customDecoders = map[string]string{
|
||||
|
||||
+11
-2
@@ -38,8 +38,11 @@ type PrimitiveTypes struct {
|
||||
Uint32String uint32 `json:",string"`
|
||||
Uint64String uint64 `json:",string"`
|
||||
|
||||
Float32 float32 `json:",string"`
|
||||
Float64 float64 `json:",string"`
|
||||
Float32 float32
|
||||
Float64 float64
|
||||
|
||||
Float32String float32 `json:",string"`
|
||||
Float64String float64 `json:",string"`
|
||||
|
||||
Ptr *string
|
||||
PtrNil *string
|
||||
@@ -77,6 +80,9 @@ var primitiveTypesValue = PrimitiveTypes{
|
||||
Float32: 1.5,
|
||||
Float64: math.MaxFloat64,
|
||||
|
||||
Float32String: 1.5,
|
||||
Float64String: math.MaxFloat64,
|
||||
|
||||
Ptr: &str,
|
||||
}
|
||||
|
||||
@@ -110,6 +116,9 @@ var primitiveTypesString = "{" +
|
||||
`"Float32":` + fmt.Sprint(1.5) + `,` +
|
||||
`"Float64":` + fmt.Sprint(math.MaxFloat64) + `,` +
|
||||
|
||||
`"Float32String":"` + fmt.Sprint(1.5) + `",` +
|
||||
`"Float64String":"` + fmt.Sprint(math.MaxFloat64) + `",` +
|
||||
|
||||
`"Ptr":"bla",` +
|
||||
`"PtrNil":null` +
|
||||
|
||||
|
||||
Reference in New Issue
Block a user