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

Function test_file_store_backslash_sanitization

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

Source from the content-addressed store, hash-verified

545
546#[tokio::test]
547async fn test_file_store_backslash_sanitization() {
548 let dir = tempdir().unwrap();
549 let store = FileSessionStore::new(dir.path()).await.unwrap();
550
551 let mut session = create_test_session_data();
552 session.id = r"foo\bar\baz".to_string();
553 store.save(&session).await.unwrap();
554
555 let loaded = store.load(&session.id).await.unwrap();
556 assert!(loaded.is_some());
557
558 let loaded = loaded.unwrap();
559 assert_eq!(loaded.id, session.id);
560
561 // Verify the file on disk uses sanitized name
562 let expected_path = dir.path().join("foo_bar_baz.json");
563 assert!(expected_path.exists());
564}
565
566#[tokio::test]
567async fn test_file_store_mixed_separator_sanitization() {

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