testutil

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareGenerated

func CompareGenerated(t *testing.T, generated, expected []byte)

CompareGenerated compares generated code with expected code, stripping the package line since generated code uses a different package name than tests.

func ConcatenateFiles

func ConcatenateFiles(files []generators.GeneratedFile) []byte

ConcatenateFiles combines all generated files into a single byte slice. Useful for comparing multi-file output against a single concatenated expected file.

func GetSingleFile

func GetSingleFile(t *testing.T, files []generators.GeneratedFile) []byte

GetSingleFile extracts the content from a single-file generation result. Fails the test if there isn't exactly one file.

func WriteAndCompareMultipleFiles

func WriteAndCompareMultipleFiles(t *testing.T, files []generators.GeneratedFile, outputDir, expectedDir string)

WriteAndCompareMultipleFiles writes all generated files to the output directory and compares each one to the corresponding expected file. Expected files should be in the expectedDir with matching filenames.

Types

This section is empty.

Jump to

Keyboard shortcuts

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