spec

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateImplementation

func ValidateImplementation(impl *Section, iface *Section) []string

ValidateImplementation checks if an implementation has all required sections from the interface Returns a list of missing section titles (normalized to lowercase)

Types

type Section

type Section struct {
	Level    int        // Heading level (1, 2, 3...)
	Number   string     // Auto-generated: "1.1.1"
	Title    string     // "Parse Markdown headings"
	Content  string     // Everything between this heading and next
	TestName string     // "TestParseMarkdownHeadings" (empty if not a leaf)
	Children []*Section // Nested sections
	Parent   *Section   // Parent section (nil for root)
}

Section represents a section in the specification

func (*Section) GetImplementedInterface

func (s *Section) GetImplementedInterface() string

func (*Section) HasTest

func (s *Section) HasTest() bool

HasTest returns true if this section has a test reference

func (*Section) IsInterface

func (s *Section) IsInterface() bool

func (*Section) IsLeaf

func (s *Section) IsLeaf() bool

IsLeaf returns true if this section has no children

func (*Section) RequiresTest

func (s *Section) RequiresTest() bool

RequiresTest returns true if this section requires a test reference Interfaces and their children don't require tests

type Specification

type Specification struct {
	FilePath string
	Sections []*Section
}

Specification represents a parsed specification document

func (*Specification) AllLeaves

func (s *Specification) AllLeaves() []*Section

AllLeaves returns all leaf sections in the tree

func (*Specification) RequiredTests

func (s *Specification) RequiredTests() []string

RequiredTests returns all test names that should exist

func (*Specification) ValidateInterfaces

func (s *Specification) ValidateInterfaces() map[string][]string

ValidateInterfaces checks all implementations against their interfaces Returns a map of implementation titles to their missing sections

Jump to

Keyboard shortcuts

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