()
| 906 | |
| 907 | #[test] |
| 908 | fn test_embedded_struct() { |
| 909 | let mut parser = GoParser::new(); |
| 910 | let source = r#" |
| 911 | package main |
| 912 | |
| 913 | type Base struct { |
| 914 | ID string |
| 915 | } |
| 916 | |
| 917 | type Extended struct { |
| 918 | Base |
| 919 | Extra string |
| 920 | } |
| 921 | "#; |
| 922 | let entities = parser.extract(source, "models.go"); |
| 923 | assert!( |
| 924 | entities.iter().any(|e| e.name == "Base"), |
| 925 | "Should find Base struct" |
| 926 | ); |
| 927 | assert!( |
| 928 | entities.iter().any(|e| e.name == "Extended"), |
| 929 | "Should find Extended struct" |
| 930 | ); |
| 931 | } |
| 932 | } |