class

Krikri::DifferentialFuzz::Generator

Inherits Reference < Object

Structured, seeded expression generator: builds a typed AST (with reasonable type compatibility between operators, filters and operands) and serializes it to Jinja expression text. Deliberately type-mismatched combinations are still produced at a controlled rate - how the two evaluators treat invalid input is itself part of the contract under test - but the bulk of generated expressions are valid.

Constants

ARITHMETIC = ["+", "-", "*", "/", "//", "%"]
COMPARISONS = ["==", "!=", "<", ">", "<=", ">="]
STRING_POOL = ["a", "b", "abc", "", "17", "3.5", "hello world", "x,y", "True"]

Constructors

new(rng : Random, max_depth : Int32 = 4)
Source

Instance methods

generate
Source