MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_build_context_string

Function test_build_context_string

atomic-repository/src/ai/mod.rs:605–632  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

603
604 #[test]
605 fn test_build_context_string() {
606 let nodes = vec![
607 KgNode::new(
608 "change:abc",
609 atomic_core::kg::ontology::Class::Change,
610 "abc123",
611 "graph",
612 )
613 .with_summary("Fix auth bug"),
614 KgNode::new(
615 "file:src/auth.rs",
616 atomic_core::kg::ontology::Class::File,
617 "src/auth.rs",
618 "graph",
619 ),
620 ];
621 let edges = vec![KgEdge::new(
622 "change:abc",
623 "file:src/auth.rs",
624 atomic_core::kg::ontology::Predicate::ModifiesFile,
625 )];
626
627 let context = build_context_string(&nodes, &edges, "who fixed auth?");
628 assert!(context.contains("abc123"));
629 assert!(context.contains("Fix auth bug"));
630 assert!(context.contains("atomic:modifiesFile"));
631 assert!(context.contains("who fixed auth?"));
632 }
633
634 #[test]
635 fn test_build_context_string_empty() {

Callers

nothing calls this directly

Calls 1

build_context_stringFunction · 0.85

Tested by

no test coverage detected