MCPcopy Create free account
hub / github.com/ScriptedAlchemy/tracedecay / test_rust_async_function

Function test_rust_async_function

tests/extraction_suite/rust.rs:60–76  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

58
59#[test]
60fn test_rust_async_function() {
61 let source = r#"
62pub async fn fetch_data() -> String {
63 String::new()
64}
65"#;
66 let extractor = RustExtractor;
67 let result = extractor.extract("async.rs", source);
68 assert!(result.errors.is_empty(), "errors: {:?}", result.errors);
69 let fns: Vec<_> = result
70 .nodes
71 .iter()
72 .filter(|n| n.kind == NodeKind::Function)
73 .collect();
74 assert_eq!(fns.len(), 1);
75 assert!(fns[0].is_async, "expected async function");
76}
77
78#[test]
79fn test_rust_struct_and_fields() {

Callers

nothing calls this directly

Calls 2

collectMethod · 0.80
extractMethod · 0.45

Tested by

no test coverage detected