Write a tool-call entry to a specific mmap directory (for testing).
(
dir: &Path,
project_root: &Path,
prefix: &str,
tool_name: &str,
delta: u64,
before: u64,
)
| 82 | |
| 83 | /// Write a tool-call entry to a specific mmap directory (for testing). |
| 84 | pub fn write_entry_to( |
| 85 | dir: &Path, |
| 86 | project_root: &Path, |
| 87 | prefix: &str, |
| 88 | tool_name: &str, |
| 89 | delta: u64, |
| 90 | before: u64, |
| 91 | ) { |
| 92 | let _ = std::fs::create_dir_all(dir); |
| 93 | let mmap_path = dir.join(MMAP_FILENAME); |
| 94 | let project = project_root |
| 95 | .file_name() |
| 96 | .map(|n| n.to_string_lossy().to_string()) |
| 97 | .unwrap_or_default(); |
| 98 | let _ = write_entry_inner(&mmap_path, prefix, &project, tool_name, delta, before); |
| 99 | } |
| 100 | |
| 101 | fn write_str(mmap: &mut memmap2::MmapMut, offset: usize, value: &str) { |
| 102 | let bytes = value.as_bytes(); |