cmdtest

package
v0.9.8 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2026 License: MIT Imports: 11 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cmdtest has what the tests of the command line and the server share: CONFIG_DIR trees, built function manifests, and terminal input and output.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RulesSection

func RulesSection(rules string) string

RulesSection is a collection.yaml holding the given rules: what a rules.yaml held before the rules became a section of collection.yaml. Append it to the rest of the file when the test has one.

func Write

func Write(t testing.TB, files map[string]string) string

Write writes files under a new CONFIG_DIR and returns it.

func WriteFuncManifest

func WriteFuncManifest(t testing.TB, dir string, names ...string)

WriteFuncManifest writes a one-function manifest as `backd functions build` would, so the handler's index finds a built bundle.

Types

type LockedBuffer

type LockedBuffer struct {
	// contains filtered or unexported fields
}

LockedBuffer is an output two goroutines may use.

func (*LockedBuffer) String

func (l *LockedBuffer) String() string

func (*LockedBuffer) Write

func (l *LockedBuffer) Write(p []byte) (int, error)

type Script

type Script struct {
	Steps []func() string
	// contains filtered or unexported fields
}

Script is a standard input that answers each read with the next step: a fixed line, or one made from what the command has printed so far (the secret it showed).

func (*Script) Read

func (s *Script) Read(p []byte) (int, error)

Jump to

Keyboard shortcuts

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