()
| 912 | |
| 913 | #[test] |
| 914 | fn test_extract_enum() { |
| 915 | let mut parser = CppParser::new(); |
| 916 | let source = r#" |
| 917 | enum Color { |
| 918 | Red, |
| 919 | Green, |
| 920 | Blue |
| 921 | }; |
| 922 | "#; |
| 923 | let entities = parser.extract(source, "color.cpp"); |
| 924 | let color = entities.iter().find(|e| e.name == "Color").unwrap(); |
| 925 | assert_eq!(color.kind, EntityKind::Enum); |
| 926 | assert!( |
| 927 | color.signature.as_ref().unwrap().contains("enum Color"), |
| 928 | "Signature: {:?}", |
| 929 | color.signature |
| 930 | ); |
| 931 | } |
| 932 | |
| 933 | #[test] |
| 934 | fn test_extract_include() { |