Documentation ¶
Index ¶
- Constants
- func Boot(mainSourceFile string)
- func Caller(skip int) string
- func CargoDir() string
- func ExeName(name string) string
- func Exec(name string, args []string, callback func(output string, isError bool)) (int, error)
- func ExecInDir(prefix, dir string, callback func() bool) bool
- func FileName() string
- func Glob(root, pattern string) (out []string)
- func GlobRegex(pattern string) string
- func Lines(input string) []string
- func MatchesPattern(input, pattern string) bool
- func NoError(err error, msg string)
- func ProjectDir() string
- func ReadJson(filename string, output any) any
- func ReadText(filename string) string
- func Relative(base, path string) string
- func Run(prefix, name string, args ...string) bool
- func Spawn(name string, args ...string) error
- func TrimLines(lines []string) []string
- func WithExtension(filename string, ext string) string
- type CommonSequence
- type Diff
- type DiffBlock
- type Runner
- type ScriptTest
Constants ¶
const ( PackageDir = "bootstrap" CargoWorkspace = "byte-rs" )
const RegexpIgnoreCase = "(?i)"
Variables ¶
This section is empty.
Functions ¶
func Boot ¶
func Boot(mainSourceFile string)
Performs the boot routine for the bootstrap process. This will check if the bootstrapper needs to be update and rebuild itself, restarting the process if that is the case.
func MatchesPattern ¶
func Spawn ¶
Spawn a new process "replaces" the current process by the given one.
The new process shares the same environment and standard output streams as the current process.
After the spawned process exits, the current process will exit with the same exit code.
func WithExtension ¶
Types ¶
type CommonSequence ¶
func LCS ¶
func LCS[T comparable](a []T, b []T) (out []CommonSequence)
Compute the Longest Common Subsequence (LCS) of A and B.
type Diff ¶
type Diff[T comparable] struct { // contains filtered or unexported fields }
func Compare ¶
func Compare[T comparable](input, output []T) Diff[T]
type DiffBlock ¶
Represents a block of removed, inserted, or equal elements.
`Kind` represents the type of block:
- If 0 -> this is a run of equal elements between `Src` and `Dst`; - If -1 -> this is a block of elements from `Src` removed from `Dst`; - If +1 -> this is a block of elements from `Dst` inserted into `Src`.
type Runner ¶
type Runner struct {
// contains filtered or unexported fields
}
func (Runner) ExecScript ¶
type ScriptTest ¶
type ScriptTest struct { Name string File string Error error Success bool Skipped bool Directory string Expected any StdOut string StdErr string ExitCode int ExpectOutput []string ActualOutput []string }
func RunScriptTest ¶
func RunScriptTest(scriptFileName string) (out ScriptTest)
func (*ScriptTest) CheckResult ¶
func (test *ScriptTest) CheckResult()
func (ScriptTest) OutputDetails ¶
func (test ScriptTest) OutputDetails()