scenario

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package scenario parses markdown rehearse scenario files: body metadata (`**Verifies:**` / `**Status:**`) and fenced step blocks with info-string params (REQ: scenario-shape). Parsing only — no execution.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Block

type Block struct {
	// Kind is the first info-string token (e.g. "bash", "sql"). Empty for a
	// bare “` fence.
	Kind string
	// Params holds the remaining info-string tokens as key=value pairs; a
	// bare token maps to the empty string.
	Params map[string]string
	// Body is the verbatim block content (without the fence lines).
	Body string
	// Line is the 1-based line number of the opening fence.
	Line int
}

Block is one fenced block extracted from a scenario file.

type Scenario

type Scenario struct {
	// Path is the file the scenario was parsed from.
	Path string
	// Verifies lists the AC ids from the `**Verifies:**` body metadata,
	// parenthetical annotations stripped. Never nil.
	Verifies []string
	// Status is the `**Status:**` body metadata value (e.g. "pending").
	Status string
	// Blocks are all fenced blocks in document order.
	Blocks []Block
}

Scenario is one parsed scenario file.

func Parse

func Parse(path string) (*Scenario, error)

Parse reads and parses the scenario file at path.

func ParseBytes

func ParseBytes(path string, data []byte) (*Scenario, error)

ParseBytes parses scenario content already in memory. path is used for error messages only.

Jump to

Keyboard shortcuts

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