Documentation
¶
Overview ¶
Package scripttest replays the scripted cases the previous runtime's modules ran (the golden files of the checkpoint store and of the routes over git): the same file and git actions in a temporary folder, and the same dumps of a working folder and a shadow repository, so a Go test compares like with like.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Action ¶
type Action struct {
Path string `json:"path"`
PathB64 string `json:"pathB64"`
Write *string `json:"write"`
B64 *string `json:"b64"`
Repeat *string `json:"repeat"`
Count int `json:"count"`
Mode *int `json:"mode"`
Link *string `json:"link"`
Rm bool `json:"rm"`
Mkdir bool `json:"mkdir"`
Chmod *int `json:"chmod"`
Mtime *int64 `json:"mtime"`
Git []string
Date string
}
Action is one step on the files: write (text, base64 or a repeated string), link, rm, mkdir, chmod, mtime, or a git command run in the folder (with a fixed author and, given a date, fixed dates).
type World ¶
type World struct {
Root string
// contains filtered or unexported fields
}
World is a script's temporary folder; HOME and XDG_CONFIG_HOME point into it, so git reads no person's config.
func New ¶
New is a fresh world; roots are the working folders a script names (their hashes are scrubbed too).
func (*World) Apply ¶
Apply runs file and git actions; a file action that fails is skipped from where it failed, as gen.mjs skipped it.
func (*World) DumpRepo ¶
DumpRepo is a shadow repository: its refs (the namespace written as NS; commits by tree and subject, other objects by id), its own files and leftover temporary files.
func (*World) DumpTree ¶
DumpTree is every entry of a working folder but .git folders, by raw name: folders, files by mode and content hash, links by target.