Skip to main content

diagnose

Function diagnose 

Source
pub fn diagnose(case: &Case) -> Report
Expand description

Run every rule, sort firing diagnoses by descending confidence, and return a Report with the top hit as primary and the rest in also_considered.

Tie-breaking is alphabetical on rule_id so output is byte-stable.

ยงExamples

use api_debug_lab::{diagnose, Case};
use std::path::Path;

let case = Case::load("auth_missing", Path::new("fixtures"))?;
let report = diagnose(&case);
assert_eq!(report.primary.unwrap().rule_id, "auth_missing");