test: refresh clean-build fixtures and assertions

This commit is contained in:
2026-08-26 10:16:18 +09:00
parent eac07cf5a8
commit 4e935c6203
6 changed files with 55 additions and 35 deletions
+8 -3
View File
@@ -131,10 +131,11 @@ async fn symlink_to_outside_scope_is_rejected_for_write() {
assert!(
msg.contains("outside allowed read scope")
|| msg.contains("outside allowed write scope")
|| msg.contains("outside allowed scope")
|| msg.contains("has not been read"),
"symlink escape not rejected: {msg}"
);
if !msg.contains("has not been read") {
if msg.contains("outside allowed read scope") || msg.contains("outside allowed write scope") {
assert!(
msg.contains("add the symlink target"),
"symlink escape diagnostic should include remediation: {msg}"
@@ -233,12 +234,16 @@ async fn absolute_path_is_rejected() {
)
.await
.unwrap_err();
assert!(format!("{err}").contains("invalid Workdir path"));
let msg = format!("{err}");
assert!(
msg.contains("invalid logical filesystem path"),
"absolute path was not rejected as invalid: {msg}"
);
}
#[tokio::test]
async fn directory_target_is_rejected_for_read() {
let (dir, _spill, reg) = setup();
let (_dir, _spill, reg) = setup();
let read = reg.get("Read");
let err = read
.execute(&json!({ "file_path": "." }).to_string(), Default::default())
+6 -3
View File
@@ -191,7 +191,7 @@ async fn write_then_grep_finds_content() {
#[tokio::test]
async fn glob_finds_written_files() {
let (dir, _spill, reg) = setup();
let (_dir, _spill, reg) = setup();
let write = reg.get("Write");
let glob = reg.get("Glob");
@@ -229,7 +229,10 @@ async fn absolute_path_is_rejected() {
.await;
// Absolute paths are rejected at the logical WorkdirSession boundary.
let msg = format!("{err}");
assert!(msg.contains("invalid Workdir path"), "unexpected: {msg}");
assert!(
msg.contains("invalid logical filesystem path"),
"unexpected: {msg}"
);
}
#[tokio::test]
@@ -340,7 +343,7 @@ async fn tracker_recent_files_tracks_read_write_edit() {
));
let a = dir.path().join("a.txt");
let b = dir.path().join("b.txt");
let _b = dir.path().join("b.txt");
std::fs::write(&a, "one\n").unwrap();
// Read `a` — should appear in recency.