test

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadTestData

func LoadTestData(filename string, target any) error

func SetupList

func SetupList(input *[]TestStructB, expected *map[string]any) error

func SetupSingle

func SetupSingle(input *TestStructA, expected *map[string]any) error

Types

type TestNested

type TestNested struct {
	FieldA string `json:"fieldA" explain:"Explanation for field A"`
	FieldB int    `json:"fieldB" explain:"Explanation for field B"`
}

type TestNestedTwice

type TestNestedTwice struct {
	FieldC TestNested `json:"fieldC" explain:"Explanation for field C"`
}

type TestStructA

type TestStructA struct {
	SimpleField string          `json:"simpleField" explain:"A simple string field"`
	NumberField int             `json:"numberField" explain:"A numeric field"`
	Nested      TestNested      `json:"nested" explain:"Nested struct"`
	NestedTwice TestNestedTwice `json:"nestedTwice" explain:"Twice nested struct"`
	Pointer     *TestNested     `json:"pointer" explain:"Pointer to nested"`
	Slice       []TestNested    `json:"slice" explain:"Slice of nested structs"`
}

type TestStructB

type TestStructB struct {
	SimpleField string       `json:"simpleField" explain:"A simple string field"`
	NumberField int          `json:"numberField" explain:"A numeric field"`
	Nested      TestNested   `json:"nested" explain:"Nested struct"`
	Pointer     *TestNested  `json:"pointer" explain:"Pointer to nested"`
	Slice       []TestNested `json:"slice" explain:"Slice of nested structs"`
}

Jump to

Keyboard shortcuts

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