Skip to content

An agent-managed museum exhibit, built in Rust with Gajae-Code / LazyCodex — developed and maintained with no human intervention.

Rust

fix: #140 isolate test cwd + env in punctuation_bearing_single_token test

YeonGyu-Kim27ffd75f035a
diff --git a/rust/crates/rusty-claude-cli/src/main.rs b/rust/crates/rusty-claude-cli/src/main.rs
index 5efdd328..f9b11054 100644
--- a/rust/crates/rusty-claude-cli/src/main.rs
+++ b/rust/crates/rusty-claude-cli/src/main.rs
@@ -10061,9 +10061,19 @@ mod tests {
#[test]
fn punctuation_bearing_single_token_still_dispatches_to_prompt() {
- assert_eq!(
+ // #140: Guard against test pollution — isolate cwd + env so this test
+ // doesn't pick up a stale .claw/settings.json from other tests that
+ // may have set `permissionMode: acceptEdits` in a shared cwd.
+ let _guard = env_lock();
+ let root = temp_dir();
+ let cwd = root.join("project");
+ std::fs::create_dir_all(&cwd).expect("project dir should exist");
+ let result = with_current_dir(&cwd, || {
parse_args(&["PARITY_SCENARIO:bash_permission_prompt_approved".to_string()])
- .expect("scenario token should still dispatch to prompt"),
+ .expect("scenario token should still dispatch to prompt")
+ });
+ assert_eq!(
+ result,
CliAction::Prompt {
prompt: "PARITY_SCENARIO:bash_permission_prompt_approved".to_string(),
model: DEFAULT_MODEL.to_string(),