Documentation ¶
Overview ¶
Package chezmoitest contains test helper functions for chezmoi.
Index ¶
- Variables
- func AGEGenerateKey(filename string) (publicKey, privateKeyFile string, err error)
- func GPGCommand() (string, error)
- func GPGGenerateKey(command, homeDir string) (key, passphrase string, err error)
- func HomeDir() string
- func JoinLines(lines ...string) string
- func SkipUnlessGOOS(t *testing.T, name string)
- func WithTestFS(t *testing.T, root interface{}, f func(vfs.FS))
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 ¶
AGEGenerateKey generates and returns an age public key and the path to the private key. If filename is non-zero then the private key is written to it, otherwise a new file is created in a temporary directory and the caller is responsible for removing the temporary directory.
func GPGCommand ¶
GPGCommand returns the path to gpg, if it can be found.
func GPGGenerateKey ¶
GPGGenerateKey generates GPG key in homeDir and returns the key and the passphrase.
func SkipUnlessGOOS ¶
SkipUnlessGOOS calls t.Skip() if name does not match runtime.GOOS.
func WithTestFS ¶
WithTestFS calls f with a test filesystem populated with root.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.