()
| 935 | |
| 936 | #[test] |
| 937 | fn test_extract_enum() { |
| 938 | let mut parser = CppParser::new(); |
| 939 | let source = r#" |
| 940 | enum Color { |
| 941 | Red, |
| 942 | Green, |
| 943 | Blue |
| 944 | }; |
| 945 | "#; |
| 946 | let entities = parser.extract(source, "color.cpp"); |
| 947 | let color = entities.iter().find(|e| e.name == "Color").unwrap(); |
| 948 | assert_eq!(color.kind, EntityKind::Enum); |
| 949 | assert!( |
| 950 | color.signature.as_ref().unwrap().contains("enum Color"), |
| 951 | "Signature: {:?}", |
| 952 | color.signature |
| 953 | ); |
| 954 | } |
| 955 | |
| 956 | #[test] |
| 957 | fn test_extract_include() { |