dittotesting

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 30, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Git added in v0.9.0

func Git(t *testing.T, dir string, args ...string)

Git runs one git command in a fixture, with the addressing this process inherited removed.

A hook exports GIT_DIR, GIT_INDEX_FILE and friends as absolute paths, and everything spawned below inherits them — so a fixture that kept them would quietly operate on the real checkout and succeed. They are REMOVED rather than blanked, because git rejects an empty GIT_DIR outright.

func GitRepository added in v0.9.0

func GitRepository(t *testing.T) string

GitRepository builds a throwaway repository with one committed Go file, tagged `base`, and returns its path. It is removed with the test's temporary directory.

func GitRepositoryWithAChange added in v0.9.0

func GitRepositoryWithAChange(t *testing.T) string

GitRepositoryWithAChange is GitRepository plus one committed Go change after the tag, which is the shape most of these questions are asked of.

func Source

func Source(doc string) []byte

func WriteFile added in v0.9.0

func WriteFile(t *testing.T, dir, name, content string)

WriteFile puts one file into a fixture, creating nothing else.

Types

This section is empty.

Jump to

Keyboard shortcuts

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