MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / test_extract_init

Function test_extract_init

atomic-semantic/src/parsers/swift.rs:875–898  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

873
874 #[test]
875 fn test_extract_init() {
876 let mut parser = SwiftParser::new();
877 let source = r#"
878class User {
879 var name: String
880
881 init(name: String) {
882 self.name = name
883 }
884}
885"#;
886 let entities = parser.extract(source, "user.swift");
887
888 let init = entities
889 .iter()
890 .find(|e| e.name == "init")
891 .expect("Should find init");
892 assert_eq!(init.kind, EntityKind::Method);
893 assert!(
894 init.signature.as_ref().unwrap().contains("init"),
895 "Signature: {:?}",
896 init.signature
897 );
898 }
899
900 #[test]
901 fn test_empty_source() {

Callers

nothing calls this directly

Calls 2

extractMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected