configtest

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssertDocsTOMLComplete

func AssertDocsTOMLComplete[C any](t *testing.T, docsTOML string)

AssertDocsTOMLComplete ensures that docsTOML contains every field in C and no extra fields.

func AssertFieldsNotNil

func AssertFieldsNotNil(t *testing.T, s interface{})

AssertFieldsNotNil recursively checks s for nil fields. s must be a struct.

func AssertFullMarshal

func AssertFullMarshal[C any](t *testing.T, c C, expTOML string)

AssertFullMarshal ensures that c encodes to expTOML and contains no nil fields.

func CheckDocsTOMLComplete

func CheckDocsTOMLComplete[C any](t *testing.T, docsTOML string) (int, error)

CheckDocsTOMLComplete ensures that docsTOML returns the number of nil fields in C and an error listing them. It requires that no extra fields are present.

func CheckFieldsNotNil

func CheckFieldsNotNil(t *testing.T, s interface{}) (int, error)

CheckFieldsNotNil recursively checks s for nil fields. s must be a struct. Returns the number of nil fields found and an error describing them.

func DocDefaultsOnly

func DocDefaultsOnly(r io.Reader, cfg any, decode func(io.Reader, any) error) error

DocDefaultsOnly reads only the default values from a docs TOML file and decodes in to cfg. Fields without defaults will set to zero values.

Types

This section is empty.

Jump to

Keyboard shortcuts

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