Behavior contract testing across MoonBit regex backends with Unicode boundary fixtures.
moon update
moon check --deny-warn
moon test --deny-warn
moon build --deny-warn
moon run examples/demo
moon run examples/demo-json
moon run examples/reference-engine
node tools/verify-demo.mjspub(all) struct CompatibilityFinding {
case_id : String
engine_id : String
kind : FindingKind
detail : String
}pub(all) struct CompatibilityReport {
baseline_id : String
case_count : Int
engine_count : Int
runs : Array[EngineRun]
findings : Array[CompatibilityFinding]
}fn CompiledMatcher::new(observe~ : (String) -> Result[MatchObservation?, String]) -> CompiledMatcherpub(all) struct ContractCase {
id : String
pattern : String
input : String
expected : ExpectedOutcome?
expected_span : (Int, Int)?
}fn ContractCase::expect_match(id~ : String, pattern~ : String, input~ : String, text~ : String, captures~ : Array[String?]) -> ContractCasefn ContractCase::expect_match_span(id~ : String, pattern~ : String, input~ : String, text~ : String, captures~ : Array[String?], start~ : Int, end~ : Int) -> ContractCasefn EngineAdapter::new(id~ : String, compile~ : (String) -> Result[CompiledMatcher, String]) -> EngineAdapterpub(all) enum EngineOutcome {
CompileRejected(String)
ExecutionFailed(String)
Completed(MatchObservation?)
} derive(Eq, Debug)impl ToJson for EngineOutcomeJsonV1pub(all) struct EngineRunJsonV1 {
case_id : String
engine_id : String
outcome : EngineOutcomeJsonV1
} derive(ToJson)pub(all) struct FindingJsonV1 {
case_id : String
engine_id : String
kind : String
detail : String
baseline : EngineOutcomeJsonV1?
actual : EngineOutcomeJsonV1?
}impl ToJson for FindingJsonV1impl ToJson for MatchJsonV1pub(all) struct ReportJsonV1 {
schema_version : Int
baseline_id : String
case_count : Int
engine_count : Int
compatible : Bool
runs : Array[EngineRunJsonV1]
findings : Array[FindingJsonV1]
} derive(ToJson)fn run_contracts(cases : Array[ContractCase], engines : Array[EngineAdapter], baseline_id : String) -> Result[CompatibilityReport, ContractError]fn unicode_category_cases(category~ : String, max_cases~ : Int) -> Result[Array[ContractCase], UnicodeCorpusError]Install
Download zipBehavior contract testing across MoonBit regex backends with Unicode boundary fixtures.