use dirigent_fermata::core::{Decision, Op, Reason, Rule};

#[test]
fn op_variants_exist() {
    let _ = Op::Read;
    let _ = Op::Write;
    let _ = Op::Execute;
}

#[test]
fn decision_allow_is_simple() {
    let d = Decision::Allow;
    assert!(matches!(d, Decision::Allow));
}

#[test]
fn decision_deny_carries_reason() {
    let rule = Rule {
        source: "/proj/.botignore".into(),
        pattern: ".env".into(),
    };
    let d = Decision::Deny(Reason {
        message: "blocked by .botignore".into(),
        rule: Some(rule),
    });
    match d {
        Decision::Deny(r) => {
            assert_eq!(r.message, "blocked by .botignore");
            assert!(r.rule.is_some());
        }
        _ => panic!("expected Deny"),
    }
}

#[test]
fn decision_ask_carries_reason() {
    let d = Decision::Ask(Reason {
        message: "needs confirmation".into(),
        rule: None,
    });
    assert!(matches!(d, Decision::Ask(_)));
}
