jsontesting

package
v0.0.0-...-f0e62f9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JsonCompare

func JsonCompare(got, want []byte) error

Types

type MarshalerUnmarshaler

type MarshalerUnmarshaler interface {
	json.Unmarshaler
	json.Marshaler
}

type RoundTripTestCase

type RoundTripTestCase struct {
	Name   string
	JSON   string
	Object json.Marshaler

	// An error that is expected when `Object` is marshalled to json
	// If `Object` does not exist, then it is inferred from the provided JSON
	ExpectedMarshalError string

	// An error that is expected when the provided JSON is unmarshalled
	// If `JSON` does not exist then this it is inferred from the provided `Object`
	ExpectedUnmarshalError string
}

func (RoundTripTestCase) RoundTripTest

func (t RoundTripTestCase) RoundTripTest(example MarshalerUnmarshaler) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL