cheat_check

Macro cheat_check 

Source
macro_rules! cheat_check {
    (
        $result:expr,
        name = $name:expr,
        condition = $cond:expr,
        protects = $protects:expr,
        severity = $severity:expr,
        cheats = [$($cheat:expr),+ $(,)?],
        consequence = $consequence:expr,
        expected = $expected:expr,
        actual = $actual:expr
    ) => { ... };
}
Expand description

Check a condition and record result with cheat metadata.

This is for the install-tests StepResult pattern. It checks a condition, adds a CheckResult to the StepResult, and documents the cheat vectors.

§Example

let mut result = StepResult::new(4, "Partition Disk");

cheat_check!(
    result,
    name = "Partition table created",
    condition = output.contains("vda1"),
    protects = "Disk has correct partitions",
    severity = "CRITICAL",
    cheats = ["Accept any output", "Skip verification"],
    consequence = "No partitions, installation fails",
    expected = "Partition vda1 exists",
    actual = format!("sfdisk output: {}", output)
);