()
| 98 | |
| 99 | #[tokio::test] |
| 100 | async fn test_insert_and_get_node() { |
| 101 | let (db, _dir) = setup_db().await; |
| 102 | let node = sample_node("node-1", "process_data", "src/main.rs"); |
| 103 | |
| 104 | db.insert_node(&node).await.expect("failed to insert node"); |
| 105 | |
| 106 | let fetched = db |
| 107 | .get_node_by_id("node-1") |
| 108 | .await |
| 109 | .expect("failed to get node") |
| 110 | .expect("node should exist"); |
| 111 | |
| 112 | assert_eq!(fetched.id, "node-1"); |
| 113 | assert_eq!(fetched.name, "process_data"); |
| 114 | assert_eq!(fetched.kind, NodeKind::Function); |
| 115 | assert_eq!(fetched.qualified_name, "crate::process_data"); |
| 116 | assert_eq!(fetched.file_path, "src/main.rs"); |
| 117 | assert_eq!(fetched.start_line, 1); |
| 118 | assert_eq!(fetched.end_line, 10); |
| 119 | assert_eq!(fetched.signature, Some("fn process_data()".to_string())); |
| 120 | assert_eq!( |
| 121 | fetched.docstring, |
| 122 | Some("Documentation for process_data".to_string()) |
| 123 | ); |
| 124 | assert_eq!(fetched.visibility, Visibility::Pub); |
| 125 | assert!(!fetched.is_async); |
| 126 | assert_eq!(fetched.updated_at, 1000); |
| 127 | } |
| 128 | |
| 129 | #[tokio::test] |
| 130 | async fn test_insert_and_get_edge() { |
nothing calls this directly
no test coverage detected