parse

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2026 License: Apache-2.0 Imports: 3 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

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