2021-01-16 16:16:26 +03:00
package json_test
import (
"bytes"
"testing"
"github.com/goccy/go-json"
)
func TestCoverUint16 ( t * testing . T ) {
type structUint16 struct {
A uint16 ` json:"a" `
}
2021-01-19 08:54:27 +03:00
type structUint16OmitEmpty struct {
A uint16 ` json:"a,omitempty" `
}
type structUint16String struct {
A uint16 ` json:"a,string" `
}
2021-01-16 16:16:26 +03:00
type structUint16Ptr struct {
A * uint16 ` json:"a" `
}
2021-01-19 08:54:27 +03:00
type structUint16PtrOmitEmpty struct {
A * uint16 ` json:"a,omitempty" `
}
type structUint16PtrString struct {
A * uint16 ` json:"a,string" `
}
2021-01-16 16:16:26 +03:00
tests := [ ] struct {
2021-02-15 05:27:47 +03:00
name string
data interface { }
2021-01-16 16:16:26 +03:00
} {
2021-01-19 08:54:27 +03:00
// HeadUint16Zero
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16Zero" ,
2021-01-16 16:16:26 +03:00
data : struct {
A uint16 ` json:"a" `
} { } ,
} ,
2021-01-19 08:54:27 +03:00
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16ZeroOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : struct {
A uint16 ` json:"a,omitempty" `
} { } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16ZeroString" ,
2021-01-19 08:54:27 +03:00
data : struct {
A uint16 ` json:"a,string" `
} { } ,
} ,
// HeadUint16
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16" ,
2021-01-16 16:16:26 +03:00
data : struct {
A uint16 ` json:"a" `
} { A : 1 } ,
} ,
2021-01-19 08:54:27 +03:00
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16OmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : struct {
A uint16 ` json:"a,omitempty" `
} { A : 1 } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16String" ,
2021-01-19 08:54:27 +03:00
data : struct {
A uint16 ` json:"a,string" `
} { A : 1 } ,
} ,
// HeadUint16Ptr
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16Ptr" ,
2021-01-16 16:16:26 +03:00
data : struct {
A * uint16 ` json:"a" `
} { A : uint16ptr ( 1 ) } ,
} ,
2021-01-19 08:54:27 +03:00
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16PtrOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : struct {
A * uint16 ` json:"a,omitempty" `
} { A : uint16ptr ( 1 ) } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16PtrString" ,
2021-01-19 08:54:27 +03:00
data : struct {
A * uint16 ` json:"a,string" `
} { A : uint16ptr ( 1 ) } ,
} ,
// HeadUint16PtrNil
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16PtrNil" ,
2021-01-16 16:16:26 +03:00
data : struct {
A * uint16 ` json:"a" `
} { A : nil } ,
} ,
2021-01-19 08:54:27 +03:00
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16PtrNilOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : struct {
A * uint16 ` json:"a,omitempty" `
} { A : nil } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16PtrNilString" ,
2021-01-19 08:54:27 +03:00
data : struct {
A * uint16 ` json:"a,string" `
} { A : nil } ,
} ,
// PtrHeadUint16Zero
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16Zero" ,
2021-01-16 16:16:26 +03:00
data : & struct {
A uint16 ` json:"a" `
} { } ,
} ,
2021-01-19 08:54:27 +03:00
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16ZeroOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : & struct {
A uint16 ` json:"a,omitempty" `
} { } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16ZeroString" ,
2021-01-19 08:54:27 +03:00
data : & struct {
A uint16 ` json:"a,string" `
} { } ,
} ,
// PtrHeadUint16
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16" ,
2021-01-16 16:16:26 +03:00
data : & struct {
A uint16 ` json:"a" `
} { A : 1 } ,
} ,
2021-01-19 08:54:27 +03:00
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16OmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : & struct {
A uint16 ` json:"a,omitempty" `
} { A : 1 } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16String" ,
2021-01-19 08:54:27 +03:00
data : & struct {
A uint16 ` json:"a,string" `
} { A : 1 } ,
} ,
// PtrHeadUint16Ptr
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16Ptr" ,
2021-01-16 16:16:26 +03:00
data : & struct {
A * uint16 ` json:"a" `
} { A : uint16ptr ( 1 ) } ,
} ,
2021-01-19 08:54:27 +03:00
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16PtrOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : & struct {
A * uint16 ` json:"a,omitempty" `
} { A : uint16ptr ( 1 ) } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16PtrString" ,
2021-01-19 08:54:27 +03:00
data : & struct {
A * uint16 ` json:"a,string" `
} { A : uint16ptr ( 1 ) } ,
} ,
// PtrHeadUint16PtrNil
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16PtrNil" ,
2021-01-16 16:16:26 +03:00
data : & struct {
A * uint16 ` json:"a" `
} { A : nil } ,
} ,
2021-01-19 08:54:27 +03:00
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16PtrNilOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : & struct {
A * uint16 ` json:"a,omitempty" `
} { A : nil } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16PtrNilString" ,
2021-01-19 08:54:27 +03:00
data : & struct {
A * uint16 ` json:"a,string" `
} { A : nil } ,
} ,
// PtrHeadUint16Nil
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16Nil" ,
2021-01-16 16:16:26 +03:00
data : ( * struct {
A * uint16 ` json:"a" `
} ) ( nil ) ,
} ,
2021-01-19 08:54:27 +03:00
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16NilOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : ( * struct {
A * uint16 ` json:"a,omitempty" `
} ) ( nil ) ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16NilString" ,
2021-01-19 08:54:27 +03:00
data : ( * struct {
A * uint16 ` json:"a,string" `
} ) ( nil ) ,
} ,
// HeadUint16ZeroMultiFields
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16ZeroMultiFields" ,
2021-01-16 16:16:26 +03:00
data : struct {
A uint16 ` json:"a" `
B uint16 ` json:"b" `
2021-02-15 05:27:47 +03:00
C uint16 ` json:"c" `
2021-01-16 16:16:26 +03:00
} { } ,
} ,
2021-01-19 08:54:27 +03:00
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16ZeroMultiFieldsOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : struct {
A uint16 ` json:"a,omitempty" `
B uint16 ` json:"b,omitempty" `
2021-02-15 05:27:47 +03:00
C uint16 ` json:"c,omitempty" `
2021-01-19 08:54:27 +03:00
} { } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16ZeroMultiFields" ,
2021-01-19 08:54:27 +03:00
data : struct {
A uint16 ` json:"a,string" `
B uint16 ` json:"b,string" `
2021-02-15 05:27:47 +03:00
C uint16 ` json:"c,string" `
2021-01-19 08:54:27 +03:00
} { } ,
} ,
// HeadUint16MultiFields
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16MultiFields" ,
2021-01-16 16:16:26 +03:00
data : struct {
A uint16 ` json:"a" `
B uint16 ` json:"b" `
2021-02-15 05:27:47 +03:00
C uint16 ` json:"c" `
} { A : 1 , B : 2 , C : 3 } ,
2021-01-16 16:16:26 +03:00
} ,
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16MultiFieldsOmitEmpty" ,
2021-01-16 16:16:26 +03:00
data : struct {
2021-01-19 08:54:27 +03:00
A uint16 ` json:"a,omitempty" `
B uint16 ` json:"b,omitempty" `
2021-02-15 05:27:47 +03:00
C uint16 ` json:"c,omitempty" `
} { A : 1 , B : 2 , C : 3 } ,
2021-01-16 16:16:26 +03:00
} ,
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16MultiFieldsString" ,
2021-01-16 16:16:26 +03:00
data : struct {
2021-01-19 08:54:27 +03:00
A uint16 ` json:"a,string" `
B uint16 ` json:"b,string" `
2021-02-15 05:27:47 +03:00
C uint16 ` json:"c,string" `
} { A : 1 , B : 2 , C : 3 } ,
2021-01-16 16:16:26 +03:00
} ,
2021-01-19 08:54:27 +03:00
// HeadUint16PtrMultiFields
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16PtrMultiFields" ,
2021-01-19 08:54:27 +03:00
data : struct {
A * uint16 ` json:"a" `
B * uint16 ` json:"b" `
2021-02-15 05:27:47 +03:00
C * uint16 ` json:"c" `
} { A : uint16ptr ( 1 ) , B : uint16ptr ( 2 ) , C : uint16ptr ( 3 ) } ,
2021-01-16 16:16:26 +03:00
} ,
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16PtrMultiFieldsOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : struct {
A * uint16 ` json:"a,omitempty" `
B * uint16 ` json:"b,omitempty" `
2021-02-15 05:27:47 +03:00
C * uint16 ` json:"c,omitempty" `
} { A : uint16ptr ( 1 ) , B : uint16ptr ( 2 ) , C : uint16ptr ( 3 ) } ,
2021-01-16 16:16:26 +03:00
} ,
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16PtrMultiFieldsString" ,
2021-01-19 08:54:27 +03:00
data : struct {
A * uint16 ` json:"a,string" `
B * uint16 ` json:"b,string" `
2021-02-15 05:27:47 +03:00
C * uint16 ` json:"c,string" `
} { A : uint16ptr ( 1 ) , B : uint16ptr ( 2 ) , C : uint16ptr ( 3 ) } ,
2021-01-16 16:16:26 +03:00
} ,
2021-01-19 08:54:27 +03:00
// HeadUint16PtrNilMultiFields
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16PtrNilMultiFields" ,
2021-01-19 08:54:27 +03:00
data : struct {
2021-01-16 16:16:26 +03:00
A * uint16 ` json:"a" `
B * uint16 ` json:"b" `
2021-02-15 05:27:47 +03:00
C * uint16 ` json:"c" `
} { A : nil , B : nil , C : nil } ,
2021-01-16 16:16:26 +03:00
} ,
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16PtrNilMultiFieldsOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : struct {
A * uint16 ` json:"a,omitempty" `
B * uint16 ` json:"b,omitempty" `
2021-02-15 05:27:47 +03:00
C * uint16 ` json:"c,omitempty" `
} { A : nil , B : nil , C : nil } ,
2021-01-16 16:16:26 +03:00
} ,
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16PtrNilMultiFieldsString" ,
2021-01-19 08:54:27 +03:00
data : struct {
A * uint16 ` json:"a,string" `
B * uint16 ` json:"b,string" `
2021-02-15 05:27:47 +03:00
C * uint16 ` json:"c,string" `
} { A : nil , B : nil , C : nil } ,
2021-01-19 08:54:27 +03:00
} ,
// PtrHeadUint16ZeroMultiFields
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16ZeroMultiFields" ,
2021-01-19 08:54:27 +03:00
data : & struct {
A uint16 ` json:"a" `
B uint16 ` json:"b" `
} { } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16ZeroMultiFieldsOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : & struct {
A uint16 ` json:"a,omitempty" `
B uint16 ` json:"b,omitempty" `
} { } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16ZeroMultiFieldsString" ,
2021-01-19 08:54:27 +03:00
data : & struct {
A uint16 ` json:"a,string" `
B uint16 ` json:"b,string" `
} { } ,
} ,
// PtrHeadUint16MultiFields
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16MultiFields" ,
2021-01-19 08:54:27 +03:00
data : & struct {
A uint16 ` json:"a" `
B uint16 ` json:"b" `
} { A : 1 , B : 2 } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16MultiFieldsOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : & struct {
A uint16 ` json:"a,omitempty" `
B uint16 ` json:"b,omitempty" `
} { A : 1 , B : 2 } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16MultiFieldsString" ,
2021-01-19 08:54:27 +03:00
data : & struct {
A uint16 ` json:"a,string" `
B uint16 ` json:"b,string" `
} { A : 1 , B : 2 } ,
} ,
// PtrHeadUint16PtrMultiFields
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16PtrMultiFields" ,
2021-01-19 08:54:27 +03:00
data : & struct {
A * uint16 ` json:"a" `
B * uint16 ` json:"b" `
} { A : uint16ptr ( 1 ) , B : uint16ptr ( 2 ) } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16PtrMultiFieldsOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : & struct {
A * uint16 ` json:"a,omitempty" `
B * uint16 ` json:"b,omitempty" `
} { A : uint16ptr ( 1 ) , B : uint16ptr ( 2 ) } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16PtrMultiFieldsString" ,
2021-01-19 08:54:27 +03:00
data : & struct {
A * uint16 ` json:"a,string" `
B * uint16 ` json:"b,string" `
} { A : uint16ptr ( 1 ) , B : uint16ptr ( 2 ) } ,
} ,
// PtrHeadUint16PtrNilMultiFields
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16PtrNilMultiFields" ,
2021-01-19 08:54:27 +03:00
data : & struct {
A * uint16 ` json:"a" `
B * uint16 ` json:"b" `
} { A : nil , B : nil } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16PtrNilMultiFieldsOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : & struct {
A * uint16 ` json:"a,omitempty" `
B * uint16 ` json:"b,omitempty" `
} { A : nil , B : nil } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16PtrNilMultiFieldsString" ,
2021-01-19 08:54:27 +03:00
data : & struct {
A * uint16 ` json:"a,string" `
B * uint16 ` json:"b,string" `
} { A : nil , B : nil } ,
} ,
// PtrHeadUint16NilMultiFields
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16NilMultiFields" ,
2021-01-19 08:54:27 +03:00
data : ( * struct {
A * uint16 ` json:"a" `
B * uint16 ` json:"b" `
} ) ( nil ) ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16NilMultiFieldsOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : ( * struct {
A * uint16 ` json:"a,omitempty" `
B * uint16 ` json:"b,omitempty" `
} ) ( nil ) ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16NilMultiFieldsString" ,
2021-01-19 08:54:27 +03:00
data : ( * struct {
A * uint16 ` json:"a,string" `
B * uint16 ` json:"b,string" `
} ) ( nil ) ,
} ,
// HeadUint16ZeroNotRoot
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16ZeroNotRoot" ,
2021-01-16 16:16:26 +03:00
data : struct {
A struct {
A uint16 ` json:"a" `
}
} { } ,
} ,
2021-01-19 08:54:27 +03:00
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16ZeroNotRootOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : struct {
A struct {
A uint16 ` json:"a,omitempty" `
}
} { } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16ZeroNotRootString" ,
2021-01-19 08:54:27 +03:00
data : struct {
A struct {
A uint16 ` json:"a,string" `
}
} { } ,
} ,
// HeadUint16NotRoot
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16NotRoot" ,
2021-01-16 16:16:26 +03:00
data : struct {
A struct {
A uint16 ` json:"a" `
}
} { A : struct {
A uint16 ` json:"a" `
} { A : 1 } } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16NotRootOmitEmpty" ,
2021-01-16 16:16:26 +03:00
data : struct {
A struct {
2021-01-19 08:54:27 +03:00
A uint16 ` json:"a,omitempty" `
2021-01-16 16:16:26 +03:00
}
} { A : struct {
2021-01-19 08:54:27 +03:00
A uint16 ` json:"a,omitempty" `
} { A : 1 } } ,
2021-01-16 16:16:26 +03:00
} ,
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16NotRootString" ,
2021-01-16 16:16:26 +03:00
data : struct {
A struct {
2021-01-19 08:54:27 +03:00
A uint16 ` json:"a,string" `
2021-01-16 16:16:26 +03:00
}
2021-01-19 08:54:27 +03:00
} { A : struct {
A uint16 ` json:"a,string" `
} { A : 1 } } ,
2021-01-16 16:16:26 +03:00
} ,
2021-01-19 08:54:27 +03:00
// HeadUint16PtrNotRoot
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16PtrNotRoot" ,
2021-01-16 16:16:26 +03:00
data : struct {
2021-01-19 08:54:27 +03:00
A struct {
A * uint16 ` json:"a" `
2021-01-16 16:16:26 +03:00
}
2021-01-19 08:54:27 +03:00
} { A : struct {
A * uint16 ` json:"a" `
} { uint16ptr ( 1 ) } } ,
2021-01-16 16:16:26 +03:00
} ,
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16PtrNotRootOmitEmpty" ,
2021-01-16 16:16:26 +03:00
data : struct {
2021-01-19 08:54:27 +03:00
A struct {
A * uint16 ` json:"a,omitempty" `
2021-01-16 16:16:26 +03:00
}
2021-01-19 08:54:27 +03:00
} { A : struct {
A * uint16 ` json:"a,omitempty" `
} { uint16ptr ( 1 ) } } ,
2021-01-16 16:16:26 +03:00
} ,
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16PtrNotRootString" ,
2021-01-16 16:16:26 +03:00
data : struct {
2021-01-19 08:54:27 +03:00
A struct {
A * uint16 ` json:"a,string" `
2021-01-16 16:16:26 +03:00
}
2021-01-19 08:54:27 +03:00
} { A : struct {
A * uint16 ` json:"a,string" `
} { uint16ptr ( 1 ) } } ,
2021-01-16 16:16:26 +03:00
} ,
2021-01-19 08:54:27 +03:00
// HeadUint16PtrNilNotRoot
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16PtrNilNotRoot" ,
2021-01-19 08:54:27 +03:00
data : struct {
A struct {
A * uint16 ` json:"a" `
}
} { } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16PtrNilNotRootOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : struct {
A struct {
A * uint16 ` json:"a,omitempty" `
}
} { } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16PtrNilNotRootString" ,
2021-01-19 08:54:27 +03:00
data : struct {
A struct {
A * uint16 ` json:"a,string" `
}
} { } ,
} ,
// PtrHeadUint16ZeroNotRoot
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16ZeroNotRoot" ,
2021-01-19 08:54:27 +03:00
data : struct {
A * struct {
A uint16 ` json:"a" `
}
} { A : new ( struct {
A uint16 ` json:"a" `
} ) } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16ZeroNotRootOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : struct {
A * struct {
A uint16 ` json:"a,omitempty" `
}
} { A : new ( struct {
A uint16 ` json:"a,omitempty" `
} ) } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16ZeroNotRootString" ,
2021-01-19 08:54:27 +03:00
data : struct {
A * struct {
A uint16 ` json:"a,string" `
}
} { A : new ( struct {
A uint16 ` json:"a,string" `
} ) } ,
} ,
// PtrHeadUint16NotRoot
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16NotRoot" ,
2021-01-19 08:54:27 +03:00
data : struct {
A * struct {
A uint16 ` json:"a" `
}
} { A : & ( struct {
A uint16 ` json:"a" `
} { A : 1 } ) } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16NotRootOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : struct {
A * struct {
A uint16 ` json:"a,omitempty" `
}
} { A : & ( struct {
A uint16 ` json:"a,omitempty" `
} { A : 1 } ) } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16NotRootString" ,
2021-01-19 08:54:27 +03:00
data : struct {
A * struct {
A uint16 ` json:"a,string" `
}
} { A : & ( struct {
A uint16 ` json:"a,string" `
} { A : 1 } ) } ,
} ,
// PtrHeadUint16PtrNotRoot
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16PtrNotRoot" ,
2021-01-19 08:54:27 +03:00
data : struct {
A * struct {
A * uint16 ` json:"a" `
}
} { A : & ( struct {
A * uint16 ` json:"a" `
} { A : uint16ptr ( 1 ) } ) } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16PtrNotRootOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : struct {
A * struct {
A * uint16 ` json:"a,omitempty" `
}
} { A : & ( struct {
A * uint16 ` json:"a,omitempty" `
} { A : uint16ptr ( 1 ) } ) } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16PtrNotRootString" ,
2021-01-19 08:54:27 +03:00
data : struct {
A * struct {
A * uint16 ` json:"a,string" `
}
} { A : & ( struct {
A * uint16 ` json:"a,string" `
} { A : uint16ptr ( 1 ) } ) } ,
} ,
// PtrHeadUint16PtrNilNotRoot
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16PtrNilNotRoot" ,
2021-01-19 08:54:27 +03:00
data : struct {
A * struct {
A * uint16 ` json:"a" `
}
} { A : & ( struct {
A * uint16 ` json:"a" `
} { A : nil } ) } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16PtrNilNotRootOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : struct {
A * struct {
A * uint16 ` json:"a,omitempty" `
}
} { A : & ( struct {
A * uint16 ` json:"a,omitempty" `
} { A : nil } ) } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16PtrNilNotRootString" ,
2021-01-19 08:54:27 +03:00
data : struct {
A * struct {
A * uint16 ` json:"a,string" `
}
} { A : & ( struct {
A * uint16 ` json:"a,string" `
} { A : nil } ) } ,
} ,
// PtrHeadUint16NilNotRoot
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16NilNotRoot" ,
2021-01-19 08:54:27 +03:00
data : struct {
A * struct {
A * uint16 ` json:"a" `
}
} { A : nil } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16NilNotRootOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : struct {
A * struct {
A * uint16 ` json:"a,omitempty" `
} ` json:",omitempty" `
} { A : nil } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16NilNotRootString" ,
2021-01-19 08:54:27 +03:00
data : struct {
A * struct {
A * uint16 ` json:"a,string" `
} ` json:",string" `
} { A : nil } ,
} ,
// HeadUint16ZeroMultiFieldsNotRoot
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16ZeroMultiFieldsNotRoot" ,
2021-01-19 08:54:27 +03:00
data : struct {
A struct {
A uint16 ` json:"a" `
}
B struct {
B uint16 ` json:"b" `
}
} { } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16ZeroMultiFieldsNotRootOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : struct {
A struct {
A uint16 ` json:"a,omitempty" `
}
B struct {
B uint16 ` json:"b,omitempty" `
}
} { } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16ZeroMultiFieldsNotRootString" ,
2021-01-19 08:54:27 +03:00
data : struct {
A struct {
A uint16 ` json:"a,string" `
}
B struct {
B uint16 ` json:"b,string" `
}
} { } ,
} ,
// HeadUint16MultiFieldsNotRoot
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16MultiFieldsNotRoot" ,
2021-01-19 08:54:27 +03:00
data : struct {
A struct {
A uint16 ` json:"a" `
}
B struct {
B uint16 ` json:"b" `
}
} { A : struct {
A uint16 ` json:"a" `
} { A : 1 } , B : struct {
B uint16 ` json:"b" `
} { B : 2 } } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16MultiFieldsNotRootOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : struct {
A struct {
A uint16 ` json:"a,omitempty" `
}
B struct {
B uint16 ` json:"b,omitempty" `
}
} { A : struct {
A uint16 ` json:"a,omitempty" `
} { A : 1 } , B : struct {
B uint16 ` json:"b,omitempty" `
} { B : 2 } } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16MultiFieldsNotRootString" ,
2021-01-19 08:54:27 +03:00
data : struct {
A struct {
A uint16 ` json:"a,string" `
}
B struct {
B uint16 ` json:"b,string" `
}
} { A : struct {
A uint16 ` json:"a,string" `
} { A : 1 } , B : struct {
B uint16 ` json:"b,string" `
} { B : 2 } } ,
} ,
// HeadUint16PtrMultiFieldsNotRoot
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16PtrMultiFieldsNotRoot" ,
2021-01-19 08:54:27 +03:00
data : struct {
A struct {
A * uint16 ` json:"a" `
}
B struct {
B * uint16 ` json:"b" `
}
} { A : struct {
A * uint16 ` json:"a" `
} { A : uint16ptr ( 1 ) } , B : struct {
B * uint16 ` json:"b" `
} { B : uint16ptr ( 2 ) } } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16PtrMultiFieldsNotRootOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : struct {
A struct {
A * uint16 ` json:"a,omitempty" `
}
B struct {
B * uint16 ` json:"b,omitempty" `
}
} { A : struct {
A * uint16 ` json:"a,omitempty" `
} { A : uint16ptr ( 1 ) } , B : struct {
B * uint16 ` json:"b,omitempty" `
} { B : uint16ptr ( 2 ) } } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16PtrMultiFieldsNotRootString" ,
2021-01-19 08:54:27 +03:00
data : struct {
A struct {
A * uint16 ` json:"a,string" `
}
B struct {
B * uint16 ` json:"b,string" `
}
} { A : struct {
A * uint16 ` json:"a,string" `
} { A : uint16ptr ( 1 ) } , B : struct {
B * uint16 ` json:"b,string" `
} { B : uint16ptr ( 2 ) } } ,
} ,
// HeadUint16PtrNilMultiFieldsNotRoot
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16PtrNilMultiFieldsNotRoot" ,
2021-01-19 08:54:27 +03:00
data : struct {
A struct {
A * uint16 ` json:"a" `
}
B struct {
B * uint16 ` json:"b" `
}
} { A : struct {
A * uint16 ` json:"a" `
} { A : nil } , B : struct {
B * uint16 ` json:"b" `
} { B : nil } } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16PtrNilMultiFieldsNotRootOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : struct {
A struct {
A * uint16 ` json:"a,omitempty" `
}
B struct {
B * uint16 ` json:"b,omitempty" `
}
} { A : struct {
A * uint16 ` json:"a,omitempty" `
} { A : nil } , B : struct {
B * uint16 ` json:"b,omitempty" `
} { B : nil } } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "HeadUint16PtrNilMultiFieldsNotRootString" ,
2021-01-19 08:54:27 +03:00
data : struct {
A struct {
A * uint16 ` json:"a,string" `
}
B struct {
B * uint16 ` json:"b,string" `
}
} { A : struct {
A * uint16 ` json:"a,string" `
} { A : nil } , B : struct {
B * uint16 ` json:"b,string" `
} { B : nil } } ,
} ,
// PtrHeadUint16ZeroMultiFieldsNotRoot
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16ZeroMultiFieldsNotRoot" ,
2021-01-19 08:54:27 +03:00
data : & struct {
A struct {
A uint16 ` json:"a" `
2021-01-16 16:16:26 +03:00
}
2021-01-19 08:54:27 +03:00
B struct {
B uint16 ` json:"b" `
}
} { } ,
2021-01-16 16:16:26 +03:00
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16ZeroMultiFieldsNotRootOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : & struct {
A struct {
A uint16 ` json:"a,omitempty" `
2021-01-16 16:16:26 +03:00
}
2021-01-19 08:54:27 +03:00
B struct {
B uint16 ` json:"b,omitempty" `
}
} { } ,
2021-01-16 16:16:26 +03:00
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16ZeroMultiFieldsNotRootString" ,
2021-01-19 08:54:27 +03:00
data : & struct {
2021-01-16 16:16:26 +03:00
A struct {
2021-01-19 08:54:27 +03:00
A uint16 ` json:"a,string" `
2021-01-16 16:16:26 +03:00
}
B struct {
2021-01-19 08:54:27 +03:00
B uint16 ` json:"b,string" `
2021-01-16 16:16:26 +03:00
}
} { } ,
} ,
2021-01-19 08:54:27 +03:00
// PtrHeadUint16MultiFieldsNotRoot
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16MultiFieldsNotRoot" ,
2021-01-19 08:54:27 +03:00
data : & struct {
2021-01-16 16:16:26 +03:00
A struct {
A uint16 ` json:"a" `
}
B struct {
B uint16 ` json:"b" `
}
} { A : struct {
A uint16 ` json:"a" `
} { A : 1 } , B : struct {
B uint16 ` json:"b" `
} { B : 2 } } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16MultiFieldsNotRootOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : & struct {
2021-01-16 16:16:26 +03:00
A struct {
2021-01-19 08:54:27 +03:00
A uint16 ` json:"a,omitempty" `
2021-01-16 16:16:26 +03:00
}
B struct {
2021-01-19 08:54:27 +03:00
B uint16 ` json:"b,omitempty" `
2021-01-16 16:16:26 +03:00
}
} { A : struct {
2021-01-19 08:54:27 +03:00
A uint16 ` json:"a,omitempty" `
} { A : 1 } , B : struct {
B uint16 ` json:"b,omitempty" `
} { B : 2 } } ,
2021-01-16 16:16:26 +03:00
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16MultiFieldsNotRootString" ,
2021-01-19 08:54:27 +03:00
data : & struct {
2021-01-16 16:16:26 +03:00
A struct {
2021-01-19 08:54:27 +03:00
A uint16 ` json:"a,string" `
2021-01-16 16:16:26 +03:00
}
B struct {
2021-01-19 08:54:27 +03:00
B uint16 ` json:"b,string" `
2021-01-16 16:16:26 +03:00
}
} { A : struct {
2021-01-19 08:54:27 +03:00
A uint16 ` json:"a,string" `
} { A : 1 } , B : struct {
B uint16 ` json:"b,string" `
} { B : 2 } } ,
2021-01-16 16:16:26 +03:00
} ,
2021-01-19 08:54:27 +03:00
// PtrHeadUint16PtrMultiFieldsNotRoot
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16PtrMultiFieldsNotRoot" ,
2021-01-16 16:16:26 +03:00
data : & struct {
2021-01-19 08:54:27 +03:00
A * struct {
A * uint16 ` json:"a" `
2021-01-16 16:16:26 +03:00
}
2021-01-19 08:54:27 +03:00
B * struct {
B * uint16 ` json:"b" `
2021-01-16 16:16:26 +03:00
}
2021-01-19 08:54:27 +03:00
} { A : & ( struct {
A * uint16 ` json:"a" `
} { A : uint16ptr ( 1 ) } ) , B : & ( struct {
B * uint16 ` json:"b" `
} { B : uint16ptr ( 2 ) } ) } ,
2021-01-16 16:16:26 +03:00
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16PtrMultiFieldsNotRootOmitEmpty" ,
2021-01-16 16:16:26 +03:00
data : & struct {
2021-01-19 08:54:27 +03:00
A * struct {
A * uint16 ` json:"a,omitempty" `
}
B * struct {
B * uint16 ` json:"b,omitempty" `
}
} { A : & ( struct {
A * uint16 ` json:"a,omitempty" `
} { A : uint16ptr ( 1 ) } ) , B : & ( struct {
B * uint16 ` json:"b,omitempty" `
} { B : uint16ptr ( 2 ) } ) } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16PtrMultiFieldsNotRootString" ,
2021-01-19 08:54:27 +03:00
data : & struct {
A * struct {
A * uint16 ` json:"a,string" `
}
B * struct {
B * uint16 ` json:"b,string" `
}
} { A : & ( struct {
A * uint16 ` json:"a,string" `
} { A : uint16ptr ( 1 ) } ) , B : & ( struct {
B * uint16 ` json:"b,string" `
} { B : uint16ptr ( 2 ) } ) } ,
} ,
// PtrHeadUint16PtrNilMultiFieldsNotRoot
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16PtrNilMultiFieldsNotRoot" ,
2021-01-19 08:54:27 +03:00
data : & struct {
A * struct {
A * uint16 ` json:"a" `
}
B * struct {
B * uint16 ` json:"b" `
}
} { A : nil , B : nil } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16PtrNilMultiFieldsNotRootOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : & struct {
A * struct {
A * uint16 ` json:"a,omitempty" `
} ` json:",omitempty" `
B * struct {
B * uint16 ` json:"b,omitempty" `
} ` json:",omitempty" `
} { A : nil , B : nil } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16PtrNilMultiFieldsNotRootString" ,
2021-01-19 08:54:27 +03:00
data : & struct {
A * struct {
A * uint16 ` json:"a,string" `
} ` json:",string" `
B * struct {
B * uint16 ` json:"b,string" `
} ` json:",string" `
} { A : nil , B : nil } ,
} ,
// PtrHeadUint16NilMultiFieldsNotRoot
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16NilMultiFieldsNotRoot" ,
2021-01-19 08:54:27 +03:00
data : ( * struct {
A * struct {
A * uint16 ` json:"a" `
}
B * struct {
B * uint16 ` json:"b" `
}
} ) ( nil ) ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16NilMultiFieldsNotRootOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : ( * struct {
A * struct {
A * uint16 ` json:"a,omitempty" `
}
B * struct {
B * uint16 ` json:"b,omitempty" `
}
} ) ( nil ) ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16NilMultiFieldsNotRootString" ,
2021-01-19 08:54:27 +03:00
data : ( * struct {
A * struct {
A * uint16 ` json:"a,string" `
}
B * struct {
B * uint16 ` json:"b,string" `
}
} ) ( nil ) ,
} ,
// PtrHeadUint16DoubleMultiFieldsNotRoot
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16DoubleMultiFieldsNotRoot" ,
2021-01-19 08:54:27 +03:00
data : & struct {
A * struct {
2021-01-16 16:16:26 +03:00
A uint16 ` json:"a" `
2021-01-19 08:54:27 +03:00
B uint16 ` json:"b" `
2021-01-16 16:16:26 +03:00
}
2021-01-19 08:54:27 +03:00
B * struct {
A uint16 ` json:"a" `
2021-01-16 16:16:26 +03:00
B uint16 ` json:"b" `
}
2021-01-19 08:54:27 +03:00
} { A : & ( struct {
2021-01-16 16:16:26 +03:00
A uint16 ` json:"a" `
B uint16 ` json:"b" `
2021-01-19 08:54:27 +03:00
} { A : 1 , B : 2 } ) , B : & ( struct {
A uint16 ` json:"a" `
B uint16 ` json:"b" `
} { A : 3 , B : 4 } ) } ,
2021-01-16 16:16:26 +03:00
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16DoubleMultiFieldsNotRootOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : & struct {
A * struct {
A uint16 ` json:"a,omitempty" `
B uint16 ` json:"b,omitempty" `
}
B * struct {
A uint16 ` json:"a,omitempty" `
B uint16 ` json:"b,omitempty" `
}
} { A : & ( struct {
A uint16 ` json:"a,omitempty" `
B uint16 ` json:"b,omitempty" `
} { A : 1 , B : 2 } ) , B : & ( struct {
A uint16 ` json:"a,omitempty" `
B uint16 ` json:"b,omitempty" `
} { A : 3 , B : 4 } ) } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16DoubleMultiFieldsNotRootString" ,
2021-01-16 16:16:26 +03:00
data : & struct {
A * struct {
2021-01-19 08:54:27 +03:00
A uint16 ` json:"a,string" `
B uint16 ` json:"b,string" `
2021-01-16 16:16:26 +03:00
}
B * struct {
2021-01-19 08:54:27 +03:00
A uint16 ` json:"a,string" `
B uint16 ` json:"b,string" `
2021-01-16 16:16:26 +03:00
}
} { A : & ( struct {
2021-01-19 08:54:27 +03:00
A uint16 ` json:"a,string" `
B uint16 ` json:"b,string" `
} { A : 1 , B : 2 } ) , B : & ( struct {
A uint16 ` json:"a,string" `
B uint16 ` json:"b,string" `
} { A : 3 , B : 4 } ) } ,
2021-01-16 16:16:26 +03:00
} ,
2021-01-19 08:54:27 +03:00
// PtrHeadUint16NilDoubleMultiFieldsNotRoot
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16NilDoubleMultiFieldsNotRoot" ,
2021-01-16 16:16:26 +03:00
data : & struct {
A * struct {
2021-01-19 08:54:27 +03:00
A uint16 ` json:"a" `
B uint16 ` json:"b" `
2021-01-16 16:16:26 +03:00
}
B * struct {
2021-01-19 08:54:27 +03:00
A uint16 ` json:"a" `
B uint16 ` json:"b" `
2021-01-16 16:16:26 +03:00
}
} { A : nil , B : nil } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16NilDoubleMultiFieldsNotRootOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : & struct {
2021-01-16 16:16:26 +03:00
A * struct {
2021-01-19 08:54:27 +03:00
A uint16 ` json:"a,omitempty" `
B uint16 ` json:"b,omitempty" `
} ` json:",omitempty" `
2021-01-16 16:16:26 +03:00
B * struct {
2021-01-19 08:54:27 +03:00
A uint16 ` json:"a,omitempty" `
B uint16 ` json:"b,omitempty" `
} ` json:",omitempty" `
} { A : nil , B : nil } ,
2021-01-16 16:16:26 +03:00
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16NilDoubleMultiFieldsNotRootString" ,
2021-01-16 16:16:26 +03:00
data : & struct {
A * struct {
2021-01-19 08:54:27 +03:00
A uint16 ` json:"a,string" `
B uint16 ` json:"b,string" `
2021-01-16 16:16:26 +03:00
}
B * struct {
2021-01-19 08:54:27 +03:00
A uint16 ` json:"a,string" `
B uint16 ` json:"b,string" `
2021-01-16 16:16:26 +03:00
}
2021-01-19 08:54:27 +03:00
} { A : nil , B : nil } ,
2021-01-16 16:16:26 +03:00
} ,
2021-01-19 08:54:27 +03:00
// PtrHeadUint16NilDoubleMultiFieldsNotRoot
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16NilDoubleMultiFieldsNotRoot" ,
2021-01-19 08:54:27 +03:00
data : ( * struct {
2021-01-16 16:16:26 +03:00
A * struct {
A uint16 ` json:"a" `
B uint16 ` json:"b" `
}
B * struct {
A uint16 ` json:"a" `
B uint16 ` json:"b" `
}
2021-01-19 08:54:27 +03:00
} ) ( nil ) ,
2021-01-16 16:16:26 +03:00
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16NilDoubleMultiFieldsNotRootOmitEmpty" ,
2021-01-16 16:16:26 +03:00
data : ( * struct {
A * struct {
2021-01-19 08:54:27 +03:00
A uint16 ` json:"a,omitempty" `
B uint16 ` json:"b,omitempty" `
2021-01-16 16:16:26 +03:00
}
B * struct {
2021-01-19 08:54:27 +03:00
A uint16 ` json:"a,omitempty" `
B uint16 ` json:"b,omitempty" `
}
} ) ( nil ) ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16NilDoubleMultiFieldsNotRootString" ,
2021-01-19 08:54:27 +03:00
data : ( * struct {
A * struct {
A uint16 ` json:"a,string" `
B uint16 ` json:"b,string" `
}
B * struct {
A uint16 ` json:"a,string" `
B uint16 ` json:"b,string" `
2021-01-16 16:16:26 +03:00
}
} ) ( nil ) ,
} ,
2021-01-19 08:54:27 +03:00
// PtrHeadUint16PtrDoubleMultiFieldsNotRoot
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16PtrDoubleMultiFieldsNotRoot" ,
2021-01-16 16:16:26 +03:00
data : & struct {
A * struct {
A * uint16 ` json:"a" `
B * uint16 ` json:"b" `
}
B * struct {
A * uint16 ` json:"a" `
B * uint16 ` json:"b" `
}
} { A : & ( struct {
A * uint16 ` json:"a" `
B * uint16 ` json:"b" `
} { A : uint16ptr ( 1 ) , B : uint16ptr ( 2 ) } ) , B : & ( struct {
A * uint16 ` json:"a" `
B * uint16 ` json:"b" `
} { A : uint16ptr ( 3 ) , B : uint16ptr ( 4 ) } ) } ,
} ,
2021-01-19 08:54:27 +03:00
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16PtrDoubleMultiFieldsNotRootOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : & struct {
A * struct {
A * uint16 ` json:"a,omitempty" `
B * uint16 ` json:"b,omitempty" `
}
B * struct {
A * uint16 ` json:"a,omitempty" `
B * uint16 ` json:"b,omitempty" `
}
} { A : & ( struct {
A * uint16 ` json:"a,omitempty" `
B * uint16 ` json:"b,omitempty" `
} { A : uint16ptr ( 1 ) , B : uint16ptr ( 2 ) } ) , B : & ( struct {
A * uint16 ` json:"a,omitempty" `
B * uint16 ` json:"b,omitempty" `
} { A : uint16ptr ( 3 ) , B : uint16ptr ( 4 ) } ) } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16PtrDoubleMultiFieldsNotRootString" ,
2021-01-19 08:54:27 +03:00
data : & struct {
A * struct {
A * uint16 ` json:"a,string" `
B * uint16 ` json:"b,string" `
}
B * struct {
A * uint16 ` json:"a,string" `
B * uint16 ` json:"b,string" `
}
} { A : & ( struct {
A * uint16 ` json:"a,string" `
B * uint16 ` json:"b,string" `
} { A : uint16ptr ( 1 ) , B : uint16ptr ( 2 ) } ) , B : & ( struct {
A * uint16 ` json:"a,string" `
B * uint16 ` json:"b,string" `
} { A : uint16ptr ( 3 ) , B : uint16ptr ( 4 ) } ) } ,
} ,
// PtrHeadUint16PtrNilDoubleMultiFieldsNotRoot
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16PtrNilDoubleMultiFieldsNotRoot" ,
2021-01-16 16:16:26 +03:00
data : & struct {
A * struct {
A * uint16 ` json:"a" `
B * uint16 ` json:"b" `
}
B * struct {
A * uint16 ` json:"a" `
B * uint16 ` json:"b" `
}
} { A : nil , B : nil } ,
} ,
2021-01-19 08:54:27 +03:00
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16PtrNilDoubleMultiFieldsNotRootOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : & struct {
A * struct {
A * uint16 ` json:"a,omitempty" `
B * uint16 ` json:"b,omitempty" `
} ` json:",omitempty" `
B * struct {
A * uint16 ` json:"a,omitempty" `
B * uint16 ` json:"b,omitempty" `
} ` json:",omitempty" `
} { A : nil , B : nil } ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16PtrNilDoubleMultiFieldsNotRootString" ,
2021-01-19 08:54:27 +03:00
data : & struct {
A * struct {
A * uint16 ` json:"a,string" `
B * uint16 ` json:"b,string" `
}
B * struct {
A * uint16 ` json:"a,string" `
B * uint16 ` json:"b,string" `
}
} { A : nil , B : nil } ,
} ,
// PtrHeadUint16PtrNilDoubleMultiFieldsNotRoot
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16PtrNilDoubleMultiFieldsNotRoot" ,
2021-01-16 16:16:26 +03:00
data : ( * struct {
A * struct {
A * uint16 ` json:"a" `
B * uint16 ` json:"b" `
}
B * struct {
A * uint16 ` json:"a" `
B * uint16 ` json:"b" `
}
} ) ( nil ) ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16PtrNilDoubleMultiFieldsNotRootOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : ( * struct {
A * struct {
A * uint16 ` json:"a,omitempty" `
B * uint16 ` json:"b,omitempty" `
}
B * struct {
A * uint16 ` json:"a,omitempty" `
B * uint16 ` json:"b,omitempty" `
}
} ) ( nil ) ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrHeadUint16PtrNilDoubleMultiFieldsNotRootString" ,
2021-01-19 08:54:27 +03:00
data : ( * struct {
A * struct {
A * uint16 ` json:"a,string" `
B * uint16 ` json:"b,string" `
}
B * struct {
A * uint16 ` json:"a,string" `
B * uint16 ` json:"b,string" `
}
} ) ( nil ) ,
} ,
// AnonymousHeadUint16
{
2021-02-15 05:27:47 +03:00
name : "AnonymousHeadUint16" ,
2021-01-19 08:54:27 +03:00
data : struct {
structUint16
B uint16 ` json:"b" `
} {
structUint16 : structUint16 { A : 1 } ,
B : 2 ,
} ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "AnonymousHeadUint16OmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : struct {
structUint16OmitEmpty
B uint16 ` json:"b,omitempty" `
} {
structUint16OmitEmpty : structUint16OmitEmpty { A : 1 } ,
B : 2 ,
} ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "AnonymousHeadUint16String" ,
2021-01-19 08:54:27 +03:00
data : struct {
structUint16String
B uint16 ` json:"b,string" `
} {
structUint16String : structUint16String { A : 1 } ,
B : 2 ,
} ,
} ,
// PtrAnonymousHeadUint16
{
2021-02-15 05:27:47 +03:00
name : "PtrAnonymousHeadUint16" ,
2021-01-19 08:54:27 +03:00
data : struct {
* structUint16
B uint16 ` json:"b" `
} {
structUint16 : & structUint16 { A : 1 } ,
B : 2 ,
} ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrAnonymousHeadUint16OmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : struct {
* structUint16OmitEmpty
B uint16 ` json:"b,omitempty" `
} {
structUint16OmitEmpty : & structUint16OmitEmpty { A : 1 } ,
B : 2 ,
} ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrAnonymousHeadUint16String" ,
2021-01-19 08:54:27 +03:00
data : struct {
* structUint16String
B uint16 ` json:"b,string" `
} {
structUint16String : & structUint16String { A : 1 } ,
B : 2 ,
} ,
} ,
// NilPtrAnonymousHeadUint16
{
2021-02-15 05:27:47 +03:00
name : "NilPtrAnonymousHeadUint16" ,
2021-01-16 16:16:26 +03:00
data : struct {
2021-01-19 08:54:27 +03:00
* structUint16
2021-01-16 16:16:26 +03:00
B uint16 ` json:"b" `
} {
2021-01-19 08:54:27 +03:00
structUint16 : nil ,
2021-01-16 16:16:26 +03:00
B : 2 ,
} ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "NilPtrAnonymousHeadUint16OmitEmpty" ,
2021-01-16 16:16:26 +03:00
data : struct {
2021-01-19 08:54:27 +03:00
* structUint16OmitEmpty
B uint16 ` json:"b,omitempty" `
2021-01-16 16:16:26 +03:00
} {
2021-01-19 08:54:27 +03:00
structUint16OmitEmpty : nil ,
B : 2 ,
2021-01-16 16:16:26 +03:00
} ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "NilPtrAnonymousHeadUint16String" ,
2021-01-16 16:16:26 +03:00
data : struct {
2021-01-19 08:54:27 +03:00
* structUint16String
B uint16 ` json:"b,string" `
2021-01-16 16:16:26 +03:00
} {
2021-01-19 08:54:27 +03:00
structUint16String : nil ,
B : 2 ,
2021-01-16 16:16:26 +03:00
} ,
} ,
2021-01-19 08:54:27 +03:00
// AnonymousHeadUint16Ptr
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "AnonymousHeadUint16Ptr" ,
2021-01-16 16:16:26 +03:00
data : struct {
structUint16Ptr
B * uint16 ` json:"b" `
} {
structUint16Ptr : structUint16Ptr { A : uint16ptr ( 1 ) } ,
B : uint16ptr ( 2 ) ,
} ,
} ,
2021-01-19 08:54:27 +03:00
{
2021-02-15 05:27:47 +03:00
name : "AnonymousHeadUint16PtrOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : struct {
structUint16PtrOmitEmpty
B * uint16 ` json:"b,omitempty" `
} {
structUint16PtrOmitEmpty : structUint16PtrOmitEmpty { A : uint16ptr ( 1 ) } ,
B : uint16ptr ( 2 ) ,
} ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "AnonymousHeadUint16PtrString" ,
2021-01-19 08:54:27 +03:00
data : struct {
structUint16PtrString
B * uint16 ` json:"b,string" `
} {
structUint16PtrString : structUint16PtrString { A : uint16ptr ( 1 ) } ,
B : uint16ptr ( 2 ) ,
} ,
} ,
// AnonymousHeadUint16PtrNil
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "AnonymousHeadUint16PtrNil" ,
2021-01-16 16:16:26 +03:00
data : struct {
structUint16Ptr
B * uint16 ` json:"b" `
} {
structUint16Ptr : structUint16Ptr { A : nil } ,
B : uint16ptr ( 2 ) ,
} ,
} ,
2021-01-19 08:54:27 +03:00
{
2021-02-15 05:27:47 +03:00
name : "AnonymousHeadUint16PtrNilOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : struct {
structUint16PtrOmitEmpty
B * uint16 ` json:"b,omitempty" `
} {
structUint16PtrOmitEmpty : structUint16PtrOmitEmpty { A : nil } ,
B : uint16ptr ( 2 ) ,
} ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "AnonymousHeadUint16PtrNilString" ,
2021-01-19 08:54:27 +03:00
data : struct {
structUint16PtrString
B * uint16 ` json:"b,string" `
} {
structUint16PtrString : structUint16PtrString { A : nil } ,
B : uint16ptr ( 2 ) ,
} ,
} ,
// PtrAnonymousHeadUint16Ptr
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "PtrAnonymousHeadUint16Ptr" ,
2021-01-16 16:16:26 +03:00
data : struct {
* structUint16Ptr
B * uint16 ` json:"b" `
} {
structUint16Ptr : & structUint16Ptr { A : uint16ptr ( 1 ) } ,
B : uint16ptr ( 2 ) ,
} ,
} ,
2021-01-19 08:54:27 +03:00
{
2021-02-15 05:27:47 +03:00
name : "PtrAnonymousHeadUint16PtrOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : struct {
* structUint16PtrOmitEmpty
B * uint16 ` json:"b,omitempty" `
} {
structUint16PtrOmitEmpty : & structUint16PtrOmitEmpty { A : uint16ptr ( 1 ) } ,
B : uint16ptr ( 2 ) ,
} ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrAnonymousHeadUint16PtrString" ,
2021-01-19 08:54:27 +03:00
data : struct {
* structUint16PtrString
B * uint16 ` json:"b,string" `
} {
structUint16PtrString : & structUint16PtrString { A : uint16ptr ( 1 ) } ,
B : uint16ptr ( 2 ) ,
} ,
} ,
// NilPtrAnonymousHeadUint16Ptr
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "NilPtrAnonymousHeadUint16Ptr" ,
2021-01-16 16:16:26 +03:00
data : struct {
* structUint16Ptr
B * uint16 ` json:"b" `
} {
structUint16Ptr : nil ,
B : uint16ptr ( 2 ) ,
} ,
} ,
2021-01-19 08:54:27 +03:00
{
2021-02-15 05:27:47 +03:00
name : "NilPtrAnonymousHeadUint16PtrOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : struct {
* structUint16PtrOmitEmpty
B * uint16 ` json:"b,omitempty" `
} {
structUint16PtrOmitEmpty : nil ,
B : uint16ptr ( 2 ) ,
} ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "NilPtrAnonymousHeadUint16PtrString" ,
2021-01-19 08:54:27 +03:00
data : struct {
* structUint16PtrString
B * uint16 ` json:"b,string" `
} {
structUint16PtrString : nil ,
B : uint16ptr ( 2 ) ,
} ,
} ,
// AnonymousHeadUint16Only
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "AnonymousHeadUint16Only" ,
2021-01-16 16:16:26 +03:00
data : struct {
structUint16
} {
structUint16 : structUint16 { A : 1 } ,
} ,
} ,
2021-01-19 08:54:27 +03:00
{
2021-02-15 05:27:47 +03:00
name : "AnonymousHeadUint16OnlyOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : struct {
structUint16OmitEmpty
} {
structUint16OmitEmpty : structUint16OmitEmpty { A : 1 } ,
} ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "AnonymousHeadUint16OnlyString" ,
2021-01-19 08:54:27 +03:00
data : struct {
structUint16String
} {
structUint16String : structUint16String { A : 1 } ,
} ,
} ,
// PtrAnonymousHeadUint16Only
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "PtrAnonymousHeadUint16Only" ,
2021-01-16 16:16:26 +03:00
data : struct {
* structUint16
} {
structUint16 : & structUint16 { A : 1 } ,
} ,
} ,
2021-01-19 08:54:27 +03:00
{
2021-02-15 05:27:47 +03:00
name : "PtrAnonymousHeadUint16OnlyOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : struct {
* structUint16OmitEmpty
} {
structUint16OmitEmpty : & structUint16OmitEmpty { A : 1 } ,
} ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrAnonymousHeadUint16OnlyString" ,
2021-01-19 08:54:27 +03:00
data : struct {
* structUint16String
} {
structUint16String : & structUint16String { A : 1 } ,
} ,
} ,
// NilPtrAnonymousHeadUint16Only
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "NilPtrAnonymousHeadUint16Only" ,
2021-01-16 16:16:26 +03:00
data : struct {
* structUint16
} {
structUint16 : nil ,
} ,
} ,
2021-01-19 08:54:27 +03:00
{
2021-02-15 05:27:47 +03:00
name : "NilPtrAnonymousHeadUint16OnlyOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : struct {
* structUint16OmitEmpty
} {
structUint16OmitEmpty : nil ,
} ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "NilPtrAnonymousHeadUint16OnlyString" ,
2021-01-19 08:54:27 +03:00
data : struct {
* structUint16String
} {
structUint16String : nil ,
} ,
} ,
// AnonymousHeadUint16PtrOnly
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "AnonymousHeadUint16PtrOnly" ,
2021-01-16 16:16:26 +03:00
data : struct {
structUint16Ptr
} {
structUint16Ptr : structUint16Ptr { A : uint16ptr ( 1 ) } ,
} ,
} ,
2021-01-19 08:54:27 +03:00
{
2021-02-15 05:27:47 +03:00
name : "AnonymousHeadUint16PtrOnlyOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : struct {
structUint16PtrOmitEmpty
} {
structUint16PtrOmitEmpty : structUint16PtrOmitEmpty { A : uint16ptr ( 1 ) } ,
} ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "AnonymousHeadUint16PtrOnlyString" ,
2021-01-19 08:54:27 +03:00
data : struct {
structUint16PtrString
} {
structUint16PtrString : structUint16PtrString { A : uint16ptr ( 1 ) } ,
} ,
} ,
// AnonymousHeadUint16PtrNilOnly
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "AnonymousHeadUint16PtrNilOnly" ,
2021-01-16 16:16:26 +03:00
data : struct {
structUint16Ptr
} {
structUint16Ptr : structUint16Ptr { A : nil } ,
} ,
} ,
2021-01-19 08:54:27 +03:00
{
2021-02-15 05:27:47 +03:00
name : "AnonymousHeadUint16PtrNilOnlyOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : struct {
structUint16PtrOmitEmpty
} {
structUint16PtrOmitEmpty : structUint16PtrOmitEmpty { A : nil } ,
} ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "AnonymousHeadUint16PtrNilOnlyString" ,
2021-01-19 08:54:27 +03:00
data : struct {
structUint16PtrString
} {
structUint16PtrString : structUint16PtrString { A : nil } ,
} ,
} ,
// PtrAnonymousHeadUint16PtrOnly
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "PtrAnonymousHeadUint16PtrOnly" ,
2021-01-16 16:16:26 +03:00
data : struct {
* structUint16Ptr
} {
structUint16Ptr : & structUint16Ptr { A : uint16ptr ( 1 ) } ,
} ,
} ,
2021-01-19 08:54:27 +03:00
{
2021-02-15 05:27:47 +03:00
name : "PtrAnonymousHeadUint16PtrOnlyOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : struct {
* structUint16PtrOmitEmpty
} {
structUint16PtrOmitEmpty : & structUint16PtrOmitEmpty { A : uint16ptr ( 1 ) } ,
} ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "PtrAnonymousHeadUint16PtrOnlyString" ,
2021-01-19 08:54:27 +03:00
data : struct {
* structUint16PtrString
} {
structUint16PtrString : & structUint16PtrString { A : uint16ptr ( 1 ) } ,
} ,
} ,
// NilPtrAnonymousHeadUint16PtrOnly
2021-01-16 16:16:26 +03:00
{
2021-02-15 05:27:47 +03:00
name : "NilPtrAnonymousHeadUint16PtrOnly" ,
2021-01-16 16:16:26 +03:00
data : struct {
* structUint16Ptr
} {
structUint16Ptr : nil ,
} ,
} ,
2021-01-19 08:54:27 +03:00
{
2021-02-15 05:27:47 +03:00
name : "NilPtrAnonymousHeadUint16PtrOnlyOmitEmpty" ,
2021-01-19 08:54:27 +03:00
data : struct {
* structUint16PtrOmitEmpty
} {
structUint16PtrOmitEmpty : nil ,
} ,
} ,
{
2021-02-15 05:27:47 +03:00
name : "NilPtrAnonymousHeadUint16PtrOnlyString" ,
2021-01-19 08:54:27 +03:00
data : struct {
* structUint16PtrString
} {
structUint16PtrString : nil ,
} ,
} ,
2021-01-16 16:16:26 +03:00
}
for _ , test := range tests {
for _ , indent := range [ ] bool { true , false } {
for _ , htmlEscape := range [ ] bool { true , false } {
var buf bytes . Buffer
enc := json . NewEncoder ( & buf )
enc . SetEscapeHTML ( htmlEscape )
if indent {
enc . SetIndent ( "" , " " )
}
if err := enc . Encode ( test . data ) ; err != nil {
2021-03-09 15:38:58 +03:00
t . Fatalf ( "%s(htmlEscape:%v,indent:%v): %+v: %s" , test . name , htmlEscape , indent , test . data , err )
2021-01-16 16:16:26 +03:00
}
2021-01-19 08:54:27 +03:00
stdresult := encodeByEncodingJSON ( test . data , indent , htmlEscape )
if buf . String ( ) != stdresult {
2021-03-09 15:38:58 +03:00
t . Errorf ( "%s(htmlEscape:%v,indent:%v): doesn't compatible with encoding/json. expected %q but got %q" , test . name , htmlEscape , indent , stdresult , buf . String ( ) )
2021-01-19 08:54:27 +03:00
}
2021-01-16 16:16:26 +03:00
}
}
}
}