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

Function test_rust_use_declarations

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

Source from the content-addressed store, hash-verified

218
219#[test]
220fn test_rust_use_declarations() {
221 let source = r#"
222use std::collections::HashMap;
223use std::io::{self, Read};
224"#;
225 let extractor = RustExtractor;
226 let result = extractor.extract("imports.rs", source);
227 assert!(result.errors.is_empty(), "errors: {:?}", result.errors);
228 let uses: Vec<_> = result
229 .nodes
230 .iter()
231 .filter(|n| n.kind == NodeKind::Use)
232 .collect();
233 assert_eq!(
234 uses.len(),
235 2,
236 "expected 2 use decls, got: {:?}",
237 uses.iter().map(|n| &n.name).collect::<Vec<_>>()
238 );
239}
240
241#[test]
242fn test_rust_const_and_static() {

Callers

nothing calls this directly

Calls 2

collectMethod · 0.80
extractMethod · 0.45

Tested by

no test coverage detected