To-Do Tools (#3902)

Co-authored-by: David Katz <dkatz@squareup.com>
This commit is contained in:
tlongwell-block
2025-08-11 15:57:17 -04:00
committed by GitHub
parent 99a40bd8d1
commit 566b9dc577
7 changed files with 804 additions and 13 deletions
+8 -13
View File
@@ -2292,33 +2292,28 @@ mod tests {
assert!(text_editor_tool
.description
.as_ref()
.map_or(false, |desc| desc
.contains("Replace a string in a file with a new string")));
.is_some_and(|desc| desc.contains("Replace a string in a file with a new string")));
assert!(text_editor_tool
.description
.as_ref()
.map_or(false, |desc| desc
.contains("the `old_str` needs to exactly match one")));
.is_some_and(|desc| desc.contains("the `old_str` needs to exactly match one")));
assert!(text_editor_tool
.description
.as_ref()
.map_or(false, |desc| desc.contains("str_replace")));
.is_some_and(|desc| desc.contains("str_replace")));
// Should not contain editor API description or edit_file command
assert!(!text_editor_tool
.description
.as_ref()
.map_or(false, |desc| desc
.contains("Edit the file with the new content")));
.is_some_and(|desc| desc.contains("Edit the file with the new content")));
assert!(!text_editor_tool
.description
.as_ref()
.map_or(false, |desc| desc.contains("edit_file")));
assert!(!text_editor_tool
.description
.as_ref()
.map_or(false, |desc| desc
.contains("work out how to place old_str with it intelligently")));
.is_some_and(|desc| desc.contains("edit_file")));
assert!(!text_editor_tool.description.as_ref().is_some_and(
|desc| desc.contains("work out how to place old_str with it intelligently")
));
temp_dir.close().unwrap();
}