...

Package testsuite

import "github.com/pelletier/go-toml/v2/internal/testsuite"
Overview
Index

Overview ▾

Package testsuite provides helper functions for interoperating with the language-agnostic TOML test suite at github.com/BurntSushi/toml-test.

func CmpJSON

func CmpJSON(t *testing.T, key string, want, have interface{})

func DecodeStdin

func DecodeStdin() error

DecodeStdin is a helper function for the toml-test binary interface. TOML input is read from STDIN and a resulting tagged JSON representation is written to STDOUT.

func EncodeStdin

func EncodeStdin() error

EncodeStdin is a helper function for the toml-test binary interface. Tagged JSON is read from STDIN and a resulting TOML representation is written to STDOUT.

func Marshal

func Marshal(v interface{}) ([]byte, error)

Marshal is a helpfer function for calling toml.Marshal

Only needed to avoid package import loops.

func Unmarshal

func Unmarshal(data []byte, v interface{}) error

Unmarshal is a helper function for calling toml.Unmarshal.

Only needed to avoid package import loops.

func ValueToTaggedJSON

func ValueToTaggedJSON(doc interface{}) ([]byte, error)

ValueToTaggedJSON takes a data structure and returns the tagged JSON representation.