97001e1544
Move all 29 workspace members from packages/<name>/ to crates/<name>/. Updates: workspace Cargo.toml (members + path deps), justfile, root CLAUDE.md, scripts/build/CARGO_INSTALL.md, docs/architecture/crates.md (renamed from packages.md), structural references in docs/architecture and docs/configuration, per-crate CLAUDE.md self-references. Historical plans, reports, and building/ docs are left untouched. No behavior change; just check-all stays green and fermata tests pass.
43 lines
946 B
Rust
43 lines
946 B
Rust
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(_)));
|
|
}
|