| 824 | |
| 825 | #[test] |
| 826 | fn test_extract_import() { |
| 827 | let mut parser = SwiftParser::new(); |
| 828 | let source = r#" |
| 829 | import Foundation |
| 830 | import UIKit |
| 831 | "#; |
| 832 | let entities = parser.extract(source, "app.swift"); |
| 833 | let imports: Vec<_> = entities |
| 834 | .iter() |
| 835 | .filter(|e| e.kind == EntityKind::Import) |
| 836 | .collect(); |
| 837 | assert!( |
| 838 | imports.len() >= 2, |
| 839 | "Should find at least 2 imports, got: {:?}", |
| 840 | imports.iter().map(|e| &e.name).collect::<Vec<_>>() |
| 841 | ); |
| 842 | } |
| 843 | |
| 844 | #[test] |
| 845 | fn test_extract_method_in_class() { |