Very nice looking tests!

Signed-off-by: Kris Nóva <kris@nivenly.com>
This commit is contained in:
Kris Nóva 2021-02-09 16:00:02 -08:00
parent 3b41c9dd5f
commit c1a45bf8e3
149 changed files with 1241 additions and 443 deletions

View file

@ -3,12 +3,11 @@ package jsoniter
import (
"errors"
"fmt"
"github.com/modern-go/reflect2"
"io"
"reflect"
"strconv"
"unsafe"
"github.com/modern-go/reflect2"
)
// Any generic object representation.

View file

@ -2,10 +2,9 @@ package jsoniter
import (
"fmt"
"github.com/modern-go/reflect2"
"io"
"unsafe"
"github.com/modern-go/reflect2"
)
func decoderOfArray(ctx *ctx, typ reflect2.Type) ValDecoder {

View file

@ -1,10 +1,9 @@
package jsoniter
import (
"github.com/modern-go/reflect2"
"reflect"
"unsafe"
"github.com/modern-go/reflect2"
)
type dynamicEncoder struct {

View file

@ -2,13 +2,12 @@ package jsoniter
import (
"fmt"
"github.com/modern-go/reflect2"
"reflect"
"sort"
"strings"
"unicode"
"unsafe"
"github.com/modern-go/reflect2"
)
var typeDecoders = map[string]ValDecoder{}

View file

@ -2,10 +2,9 @@ package jsoniter
import (
"encoding/json"
"github.com/modern-go/reflect2"
"strconv"
"unsafe"
"github.com/modern-go/reflect2"
)
type Number string

View file

@ -2,9 +2,8 @@ package jsoniter
import (
"encoding/json"
"unsafe"
"github.com/modern-go/reflect2"
"unsafe"
)
var jsonRawMessageType = reflect2.TypeOfPtr((*json.RawMessage)(nil)).Elem()

View file

@ -2,12 +2,11 @@ package jsoniter
import (
"fmt"
"github.com/modern-go/reflect2"
"io"
"reflect"
"sort"
"unsafe"
"github.com/modern-go/reflect2"
)
func decoderOfMap(ctx *ctx, typ reflect2.Type) ValDecoder {

View file

@ -1,9 +1,8 @@
package jsoniter
import (
"unsafe"
"github.com/modern-go/reflect2"
"unsafe"
)
func decoderOfOptional(ctx *ctx, typ reflect2.Type) ValDecoder {

View file

@ -2,10 +2,9 @@ package jsoniter
import (
"fmt"
"github.com/modern-go/reflect2"
"io"
"unsafe"
"github.com/modern-go/reflect2"
)
func decoderOfSlice(ctx *ctx, typ reflect2.Type) ValDecoder {

View file

@ -2,11 +2,10 @@ package jsoniter
import (
"fmt"
"github.com/modern-go/reflect2"
"io"
"reflect"
"unsafe"
"github.com/modern-go/reflect2"
)
func encoderOfStruct(ctx *ctx, typ reflect2.Type) ValEncoder {