Helper: create a sample node with reasonable defaults.
(id: &str, name: &str, file_path: &str)
| 23 | |
| 24 | /// Helper: create a sample node with reasonable defaults. |
| 25 | fn sample_node(id: &str, name: &str, file_path: &str) -> Node { |
| 26 | Node { |
| 27 | id: id.to_string(), |
| 28 | kind: NodeKind::Function, |
| 29 | name: name.to_string(), |
| 30 | qualified_name: format!("crate::{name}"), |
| 31 | file_path: file_path.to_string(), |
| 32 | start_line: 1, |
| 33 | attrs_start_line: 1, |
| 34 | end_line: 10, |
| 35 | start_column: 0, |
| 36 | end_column: 1, |
| 37 | signature: Some(format!("fn {name}()")), |
| 38 | docstring: Some(format!("Documentation for {name}")), |
| 39 | visibility: Visibility::Pub, |
| 40 | is_async: false, |
| 41 | branches: 0, |
| 42 | loops: 0, |
| 43 | returns: 0, |
| 44 | max_nesting: 0, |
| 45 | unsafe_blocks: 0, |
| 46 | unchecked_calls: 0, |
| 47 | assertions: 0, |
| 48 | updated_at: 1000, |
| 49 | parent_id: None, |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | #[tokio::test] |
| 54 | async fn test_initialize_creates_database() { |
no outgoing calls
no test coverage detected