()
| 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() { |
nothing calls this directly
no test coverage detected