INNER CODE UNIT · Rust
apply_returns_false_when_disabled
ouch-org/ouch · src/sandbox/mod.rs:162
fn apply_returns_false_when_disabled() {
let mut policy = SandboxPolicy::new();
policy.set_disabled(true);
assert!(!policy.apply());
}
#[test]
fn canonicalize_existing_path_resolves() {
let dir = tempfile::tempdir().unwrap();
let canon = canonicalize_for_sandbox(dir.path());
assert!(canon.is_absolute());
assert!(canon.exists());
}
#[test]
fn canonicalize_missing_path_falls_back_to_parent() {
let dir = tempfile::tempdir().unwrap();
let missing = dir.path().join("does-not-exist-yet.txt");