test

package
v0.3.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type TestArchive

type TestArchive struct {
	Name string
	*txtar.Archive
}

TestArchive wraps a *txtar.Archive and adds the filename of the archive

Use ar.ReadFileData( name ) []byte to get an archived file's data - []byte{} is returned if the archived file does not exist

See also as.HasFile( name ) to check for existence of a file in the archive

func TestArchives

func TestArchives() []*TestArchive

TestArchives provides shared access to all .txtar files for testing etc in multiple packages

Usage:

for _, ar := range test.TestArchives() {
	givenInput := ar.ReadFileData( "input" )
	wantOutput := ar.ReadFileData( "output" )

	gotOutput := doSomething( input )
	if gotOutput != wantOutput {
		...
	}
}

Jump to

Keyboard shortcuts

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