From 6122199ca8fbbc6ed5e51e470ca10522c97c3151 Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 20 May 2026 22:05:06 +0000 Subject: [PATCH] fix(tests): exercise the constructors and overwrite branches the tests claimed to cover `move_to::src_doesnt_exist` had two blocks labeled "overwrite false" and "overwrite true" but both passed `Overwrite::Deny`, so the Allow branch was never tested. `new_with_default::exists` lived in the `new_with_default` module but called `SingleThreadTokenFile::new`, duplicating `new::exists` and leaving the "existing file beats default" behavior of `new_with_default` uncovered. --- agent/tests/filesys/cached_file.rs | 4 +++- agent/tests/filesys/file.rs | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/agent/tests/filesys/cached_file.rs b/agent/tests/filesys/cached_file.rs index debb28ba..51338203 100644 --- a/agent/tests/filesys/cached_file.rs +++ b/agent/tests/filesys/cached_file.rs @@ -105,7 +105,9 @@ pub mod new_with_default { .unwrap(); // ensure the contents is correct - let cached_file = SingleThreadTokenFile::new(file).await.unwrap(); + let cached_file = SingleThreadTokenFile::new_with_default(file, Token::default()) + .await + .unwrap(); assert_eq!(cached_file.read().await.as_ref(), &token); } } diff --git a/agent/tests/filesys/file.rs b/agent/tests/filesys/file.rs index 36b96533..fd6431f6 100644 --- a/agent/tests/filesys/file.rs +++ b/agent/tests/filesys/file.rs @@ -470,7 +470,7 @@ pub mod move_to { // overwrite true assert!(matches!( - file.move_to(&file, Overwrite::Deny).await.unwrap_err(), + file.move_to(&file, Overwrite::Allow).await.unwrap_err(), FileSysErr::PathDoesNotExistErr { .. } )); }