Documentation ¶
Index ¶
- func ExtractScenarioTitleFromAst(node ast.Node, source []byte) (string, error)
- func ExtractScenarioVariablesFromAst(node ast.Node, source []byte) map[string]string
- func ExtractYamlMetadataFromAst(node ast.Node) map[string]interface{}
- func ParseINIFile(filePath string) (map[string]string, error)
- func ParseMarkdownIntoAst(source []byte) ast.Node
- type CodeBlock
- type ExpectedOutputBlock
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractScenarioTitleFromAst ¶
Assumes the title of the scenario is the first h1 header in the markdown file.
func ExtractScenarioVariablesFromAst ¶
Extracts the variables from a provided markdown AST.
func ExtractYamlMetadataFromAst ¶ added in v0.1.2
Extract the metadata from the AST of a markdown document.
func ParseINIFile ¶
Parses an INI file into a flat map of keys mapped to values. This reduces the complexity of the INI file to a simple key/value store and ignores the sections.
func ParseMarkdownIntoAst ¶
Parses a markdown file into an AST representing the markdown document.
Types ¶
type CodeBlock ¶
type CodeBlock struct { Language string `json:"language"` Content string `json:"content"` Header string `json:"header"` Description string `json:"description"` ExpectedOutput ExpectedOutputBlock `json:"resultBlock"` }
The representation of a code block in a markdown file.
type ExpectedOutputBlock ¶
type ExpectedOutputBlock struct { Language string `json:"language"` Content string `json:"content"` ExpectedSimilarity float64 `json:"expectedSimilarityScore"` ExpectedRegex *regexp.Regexp `json:"expectedRegexPattern"` }
The representation of an expected output block in a markdown file. This is for scenarios that have expected output that should be validated against the actual output.
Click to show internal directories.
Click to hide internal directories.