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

Function test_context_item_relevance_clamping

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

Source from the content-addressed store, hash-verified

555
556 #[test]
557 fn test_context_item_relevance_clamping() {
558 let item1 = ContextItem::new("id", ContextType::Resource, "").with_relevance(1.5);
559 assert!((item1.relevance - 1.0).abs() < f32::EPSILON);
560
561 let item2 = ContextItem::new("id", ContextType::Resource, "").with_relevance(-0.5);
562 assert!(item2.relevance.abs() < f32::EPSILON);
563 }
564
565 #[test]
566 fn test_context_item_to_xml_without_source() {

Callers

nothing calls this directly

Calls 1

with_relevanceMethod · 0.80

Tested by

no test coverage detected