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

Function test_extract_enum

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

Source from the content-addressed store, hash-verified

767
768 #[test]
769 fn test_extract_enum() {
770 let mut parser = SwiftParser::new();
771 let source = r#"
772enum Direction {
773 case north
774 case south
775 case east
776 case west
777}
778"#;
779 let entities = parser.extract(source, "types.swift");
780 let dir = entities
781 .iter()
782 .find(|e| e.name == "Direction")
783 .expect("Should find Direction");
784 assert_eq!(dir.kind, EntityKind::Enum);
785 assert!(dir.exported);
786 assert!(
787 dir.signature.as_ref().unwrap().contains("enum Direction"),
788 "Signature: {:?}",
789 dir.signature
790 );
791 }
792
793 #[test]
794 fn test_extract_protocol() {

Callers

nothing calls this directly

Calls 2

extractMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected