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

Function test_file_store_load_empty_file

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

Source from the content-addressed store, hash-verified

668
669#[tokio::test]
670async fn test_file_store_load_empty_file() {
671 let dir = tempdir().unwrap();
672 let store = FileSessionStore::new(dir.path()).await.unwrap();
673
674 // Write an empty file — JSON parse must fail gracefully, not panic
675 let empty_path = dir.path().join("empty-session.json");
676 tokio::fs::write(&empty_path, b"").await.unwrap();
677
678 let result = store.load("empty-session").await;
679 assert!(
680 result.is_err(),
681 "Empty file must return error, not Ok(None)"
682 );
683}
684
685#[tokio::test]
686async fn test_file_store_load_partial_json() {

Callers

nothing calls this directly

Calls 3

writeFunction · 0.85
pathMethod · 0.80
loadMethod · 0.45

Tested by

no test coverage detected