()
| 445 | |
| 446 | #[test] |
| 447 | fn test_extract_unexported_function() { |
| 448 | let mut parser = GoParser::new(); |
| 449 | let source = r#" |
| 450 | package main |
| 451 | |
| 452 | func helper() bool { |
| 453 | return true |
| 454 | } |
| 455 | "#; |
| 456 | let entities = parser.extract(source, "main.go"); |
| 457 | let helper = entities.iter().find(|e| e.name == "helper").unwrap(); |
| 458 | assert_eq!(helper.kind, EntityKind::Function); |
| 459 | assert!( |
| 460 | !helper.exported, |
| 461 | "lowercase function should not be exported" |
| 462 | ); |
| 463 | } |
| 464 | |
| 465 | #[test] |
| 466 | fn test_extract_struct() { |