parse

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseAtomContent

func ParseAtomContent(fact string) (string, []string, error)

ParseAtomContent splits a fact string into predicate and arguments. Example: `json_str("A", "B", "C")` -> "json_str", ["A", "B", "C"]

Types

type Feature

type Feature struct {
	Name        string
	Description string
	Scenarios   []Scenario
}

Feature represents a Gherkin feature file.

func ParseFeature

func ParseFeature(content string) (*Feature, error)

ParseFeature parses a Gherkin feature file content into a Feature struct.

type Scenario

type Scenario struct {
	Name  string
	Steps []Step
}

Scenario represents a single test scenario within a feature.

type Step

type Step struct {
	Keyword string            // Given, When, Then, And, But
	Text    string            // The full step text
	Args    map[string]string // Extracted parameters (populated by step matcher)
}

Step represents a single step (Given/When/Then) in a scenario.

func (*Step) ExtractCurlyBraceParams

func (s *Step) ExtractCurlyBraceParams() []string

ExtractCurlyBraceParams extracts parameters in {param} format.

func (*Step) ExtractQuotedStrings

func (s *Step) ExtractQuotedStrings() []string

ExtractQuotedStrings extracts all quoted strings from the step text. This is a helper for step matchers to extract parameters.

func (*Step) NormalizeStepType

func (s *Step) NormalizeStepType(lastType StepType) StepType

NormalizeStepType returns the normalized step type (Given/When/Then) for And/But steps.

type StepType

type StepType string

StepType represents the type of step.

const (
	StepTypeGiven StepType = "Given"
	StepTypeWhen  StepType = "When"
	StepTypeThen  StepType = "Then"
	StepTypeAnd   StepType = "And"
	StepTypeBut   StepType = "But"
)

Jump to

Keyboard shortcuts

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