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

Function test_file_store_load_partial_json

core/src/store/tests.rs:686–698  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

684
685#[tokio::test]
686async fn test_file_store_load_partial_json() {
687 let dir = tempdir().unwrap();
688 let store = FileSessionStore::new(dir.path()).await.unwrap();
689
690 // Truncated JSON — simulates a crash mid-write
691 let partial_path = dir.path().join("partial-session.json");
692 tokio::fs::write(&partial_path, b"{\"id\":\"partial-session\",\"message")
693 .await
694 .unwrap();
695
696 let result = store.load("partial-session").await;
697 assert!(result.is_err(), "Partial JSON must return error");
698}
699
700#[tokio::test]
701async fn test_file_store_concurrent_save() {

Callers

nothing calls this directly

Calls 3

writeFunction · 0.85
pathMethod · 0.80
loadMethod · 0.45

Tested by

no test coverage detected