contracttest

package
v0.1.11 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2026 License: AGPL-3.0 Imports: 12 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 contracttest 校验 Runtime 命令发射的原始协议 NDJSON。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Assert

func Assert(t *testing.T, command string, terminal Terminal, stdout []byte)

Assert 报告 stdout 中的每一项契约违规。

func Register

func Register(t *testing.T, command string, run Runner)

Register 对每一种终态场景运行公共契约。

Types

type Runner

type Runner func(t *testing.T, terminal Terminal) Transcript

Runner 执行一个命令场景并返回原始 transcript。

type Terminal

type Terminal string

Terminal 标识 transcript 预期的操作终态。

const (
	TerminalSuccess   Terminal = "success"
	TerminalFailure   Terminal = "failure"
	TerminalCancelled Terminal = "cancelled"
)

type Transcript

type Transcript struct {
	Stdout []byte
}

Transcript 保存命令场景写出的原始 stdout 字节。

Jump to

Keyboard shortcuts

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