Documentation
¶
Overview ¶
Package pump provides adversarial input generation for regex testing.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Generator ¶
type Generator struct {
// contains filtered or unexported fields
}
Generator generates adversarial inputs for regex patterns.
func NewGenerator ¶
NewGenerator creates a new pump pattern generator.
type Options ¶
type Options struct {
PumpSize int // Size of pumped component (default: 10)
MaxPumpSize int // Maximum pump size (default: 100)
IncludeFailure bool // Include failing suffix (default: true)
}
Options contains configuration for pump pattern generation.
type PumpPattern ¶
type PumpPattern struct {
BaseString string // The base pattern to repeat
PumpComponent string // The component to pump (repeat)
FailSuffix string // Suffix that causes failure
Description string // Description of why this triggers backtracking
Sizes []int // Suggested pump sizes to test
}
PumpPattern represents an adversarial input pattern.
func (*PumpPattern) GenerateInput ¶
func (p *PumpPattern) GenerateInput(size int) string
GenerateInput generates an actual test input from a pump pattern.
func (*PumpPattern) GenerateSequence ¶
func (p *PumpPattern) GenerateSequence() []string
GenerateSequence generates a sequence of test inputs with increasing sizes.
func (*PumpPattern) String ¶
func (p *PumpPattern) String() string
String returns a string representation of the pump pattern.
Click to show internal directories.
Click to hide internal directories.