conformance

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SchemaV1     = "mm/conformance/v1"
	PairSchemaV1 = "mm/conformance-pair/v1"
)

Variables

This section is empty.

Functions

func Run

func Run(ctx context.Context, command Command, scenario Scenario) error

func RunPair

func RunPair(ctx context.Context, oracle, candidate Command, pair PairScenario) error

Types

type Command

type Command struct {
	Path       string
	PrefixArgs []string
	Dir        string
}

type HTTPExchange

type HTTPExchange struct {
	Request  HTTPRequestExpected `json:"request"`
	Response HTTPResponse        `json:"response"`
}

type HTTPRequestExpected

type HTTPRequestExpected struct {
	Method        string            `json:"method"`
	URI           string            `json:"uri"`
	Headers       map[string]string `json:"headers,omitempty"`
	IgnoreHeaders []string          `json:"ignoreHeaders,omitempty"`
	Body          string            `json:"body,omitempty"`
}

type HTTPResponse

type HTTPResponse struct {
	Status  int               `json:"status"`
	Headers map[string]string `json:"headers,omitempty"`
	Body    string            `json:"body,omitempty"`
}

type PairScenario

type PairScenario struct {
	Schema    string   `json:"schema"`
	Name      string   `json:"name"`
	Oracle    Scenario `json:"oracle"`
	Candidate Scenario `json:"candidate"`
}

func LoadPair

func LoadPair(path string) (PairScenario, error)

type ProcessExpected

type ProcessExpected struct {
	ExitCode *int    `json:"exitCode"`
	Stdout   *string `json:"stdout"`
	Stderr   *string `json:"stderr"`
}

type Scenario

type Scenario struct {
	Schema   string            `json:"schema"`
	Name     string            `json:"name"`
	Args     []string          `json:"args"`
	Stdin    string            `json:"stdin,omitempty"`
	Timeout  *int              `json:"timeoutMs,omitempty"`
	Env      map[string]string `json:"env,omitempty"`
	HTTP     []HTTPExchange    `json:"http,omitempty"`
	Expected *ProcessExpected  `json:"expected"`
}

func Load

func Load(path string) (Scenario, error)

Jump to

Keyboard shortcuts

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