Documentation
¶
Index ¶
- func CompareGenerated(t *testing.T, generated, expected []byte)
- func ConcatenateFiles(files []generators.GeneratedFile) []byte
- func GetSingleFile(t *testing.T, files []generators.GeneratedFile) []byte
- func WriteAndCompareMultipleFiles(t *testing.T, files []generators.GeneratedFile, outputDir, expectedDir string)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareGenerated ¶
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.