From 28daeaeec0b0125ef7b462aabb1a08553601df08 Mon Sep 17 00:00:00 2001 From: kevin zhao Date: Mon, 1 Dec 2025 19:48:29 -0500 Subject: [PATCH] delete weird test --- codex-rs/execpolicy/tests/basic.rs | 45 ------------------------------ 1 file changed, 45 deletions(-) diff --git a/codex-rs/execpolicy/tests/basic.rs b/codex-rs/execpolicy/tests/basic.rs index 654291cc98..37bc526464 100644 --- a/codex-rs/execpolicy/tests/basic.rs +++ b/codex-rs/execpolicy/tests/basic.rs @@ -453,48 +453,3 @@ fn heuristics_match_is_returned_when_no_policy_matches() { evaluation ); } - -#[test] -fn heuristics_only_runs_for_commands_without_policy_matches() { - let policy_src = r#" -prefix_rule( - pattern = ["git"], - decision = "allow", -) - "#; - let mut parser = PolicyParser::new(); - parser - .parse("policy.codexpolicy", policy_src) - .expect("parse policy"); - let policy = parser.build(); - - let commands = vec![tokens(&["git", "status"]), tokens(&["python"])]; - let heuristics_calls = Arc::new(Mutex::new(Vec::new())); - let heuristics_call_log = Arc::clone(&heuristics_calls); - let heuristics = move |cmd: &[String]| { - heuristics_call_log - .lock() - .expect("lock heuristics call log") - .push(cmd.to_vec()); - Decision::Prompt - }; - - let evaluation = policy.check_multiple(&commands, &heuristics); - - assert_eq!(Decision::Prompt, evaluation.decision); - assert!(evaluation.matched_rules.iter().any(|rule_match| { - matches!( - rule_match, - RuleMatch::HeuristicsRuleMatch { - command, - decision: Decision::Prompt - } if command == &tokens(&["python"]) - ) - })); - assert_eq!( - vec![tokens(&["python"])], - *heuristics_calls - .lock() - .expect("lock heuristics call log after evaluation") - ); -}