MCPcopy Create free account
hub / github.com/AI45Lab/Code / seed

Function seed

core/src/workspace/mod.rs:1086–1092  ·  view source on GitHub ↗

Seed a file into the mock and return its current version, so callers can use it as an expected value without hardcoding the version scheme.

(fs: &Arc<InMemoryFileSystem>, path: &str, content: &str)

Source from the content-addressed store, hash-verified

1084 /// can use it as an expected value without hardcoding the version
1085 /// scheme.
1086 async fn seed(fs: &Arc<InMemoryFileSystem>, path: &str, content: &str) -> String {
1087 use super::WorkspaceFileSystemExt;
1088 let ws_path = WorkspacePath::from_normalized(path);
1089 (*fs).write_text(&ws_path, content).await.unwrap();
1090 let (_, version) = (*fs).read_text_with_version(&ws_path).await.unwrap();
1091 version
1092 }
1093
1094 #[test]
1095 fn version_conflict_is_downcastable_from_anyhow() {

Calls 2

write_textMethod · 0.45

Tested by

no test coverage detected