chezmoitest

package
v2.40.3 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2023 License: MIT Imports: 13 Imported by: 0

Documentation

Overview

Package chezmoitest contains test helper functions for chezmoi.

Index

Constants

This section is empty.

Variables

View Source
var (

	// Umask is the umask used in tests.
	//
	// If you change this then you will need to update the testscripts in
	// testdata/scripts where permissions after applying umask are hardcoded as
	// strings. Pure Go tests should use this value to ensure that they pass,
	// irrespective of what it is set to. Be aware that the process's umask is a
	// process-level property and cannot be locally changed within individual
	// tests.
	Umask = mustParseFileMode(umaskStr)
)

Functions

func AgeGenerateKey added in v2.4.0

func AgeGenerateKey(identityFile string) (string, error)

AgeGenerateKey generates an identity in identityFile and returns the recipient.

func GPGGenerateKey

func GPGGenerateKey(command, homeDir string) (key, passphrase string, err error)

GPGGenerateKey generates GPG key in homeDir and returns the key and the passphrase.

func HomeDir

func HomeDir() string

HomeDir returns the home directory.

func JoinLines

func JoinLines(lines ...string) string

JoinLines joins lines with newlines.

func SkipUnlessGOOS

func SkipUnlessGOOS(t *testing.T, name string)

SkipUnlessGOOS calls t.Skip() if name does not match runtime.GOOS.

func WithTestFS

func WithTestFS(t *testing.T, root any, f func(vfs.FS))

WithTestFS calls f with a test filesystem populated with root.

Types

This section is empty.

Jump to

Keyboard shortcuts

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