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

Function test_file_store_mixed_separator_sanitization

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

Source from the content-addressed store, hash-verified

565
566#[tokio::test]
567async fn test_file_store_mixed_separator_sanitization() {
568 let dir = tempdir().unwrap();
569 let store = FileSessionStore::new(dir.path()).await.unwrap();
570
571 let mut session = create_test_session_data();
572 session.id = r"foo/bar\baz..qux".to_string();
573 store.save(&session).await.unwrap();
574
575 let loaded = store.load(&session.id).await.unwrap();
576 assert!(loaded.is_some());
577
578 let loaded = loaded.unwrap();
579 assert_eq!(loaded.id, session.id);
580
581 // / -> _, \ -> _, .. -> _
582 let expected_path = dir.path().join("foo_bar_baz_qux.json");
583 assert!(expected_path.exists());
584}
585
586// ========================================================================
587// Error Recovery Tests

Callers

nothing calls this directly

Calls 4

create_test_session_dataFunction · 0.85
pathMethod · 0.80
saveMethod · 0.45
loadMethod · 0.45

Tested by

no test coverage detected