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

Function test_context_query_serialization

core/src/context/mod.rs:494–504  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

492
493 #[test]
494 fn test_context_query_serialization() {
495 let query = ContextQuery::new("search term")
496 .with_types([ContextType::Resource])
497 .with_session_id("sess-456");
498
499 let json = serde_json::to_string(&query).unwrap();
500 let parsed: ContextQuery = serde_json::from_str(&json).unwrap();
501
502 assert_eq!(parsed.query, "search term");
503 assert_eq!(parsed.session_id, Some("sess-456".to_string()));
504 }
505
506 #[test]
507 fn test_context_query_deserialization_with_defaults() {

Callers

nothing calls this directly

Calls 2

with_typesMethod · 0.80
with_session_idMethod · 0.45

Tested by

no test coverage detected