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

Function test_execute_plan_simple

atomic-repository/src/query_plan.rs:881–914  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

879
880 #[test]
881 fn test_execute_plan_simple() {
882 use tempfile::tempdir;
883
884 let dir = tempdir().unwrap();
885 let repo = Repository::init(dir.path()).unwrap();
886 repo.init_vault().unwrap();
887
888 // Store and index an entry
889 repo.vault_store(
890 "memory/auth.md",
891 atomic_core::pristine::vault::VaultEntryType::Memory,
892 b"# Authentication\nOAuth2 details\n".to_vec(),
893 r#"{"name":"auth"}"#.to_string(),
894 )
895 .unwrap();
896 repo.vault_index_kg("memory/auth.md").unwrap();
897
898 // Execute a simple search plan
899 let plan = parse_plan(
900 r#"{
901 "schema_version": 1,
902 "steps": [
903 {"type": "kg_search", "query": "auth", "limit": 5, "bind": "results"}
904 ]
905 }"#,
906 )
907 .unwrap();
908
909 let result = execute_plan(&repo, &plan).unwrap();
910 assert!(!result.nodes.is_empty());
911 assert!(result.elapsed_ms < 5000);
912 assert_eq!(result.step_stats.len(), 1);
913 assert_eq!(result.step_stats[0].step_type, "kg_search");
914 }
915
916 #[test]
917 fn test_execute_plan_empty() {

Callers

nothing calls this directly

Calls 8

parse_planFunction · 0.85
execute_planFunction · 0.85
vault_storeMethod · 0.80
vault_index_kgMethod · 0.80
initFunction · 0.50
unwrapMethod · 0.45
pathMethod · 0.45
init_vaultMethod · 0.45

Tested by

no test coverage detected