()
| 740 | |
| 741 | #[test] |
| 742 | fn test_empty_paths() { |
| 743 | let input = r#" |
| 744 | route / { |
| 745 | get /, post /, put / { |
| 746 | return "root"; |
| 747 | } |
| 748 | |
| 749 | get /hi { |
| 750 | return "hi; |
| 751 | } |
| 752 | } |
| 753 | "#; |
| 754 | |
| 755 | let mut parser = Parser::new(input); |
| 756 | let result = parser.parse_route().unwrap(); |
| 757 | |
| 758 | assert_eq!(result.endpoints.len(), 2); |
| 759 | let endpoint = &result.endpoints[0]; |
| 760 | assert_eq!(endpoint.path_specs.len(), 3); |
| 761 | assert_eq!(endpoint.path_specs[0].path, "/"); |
| 762 | assert_eq!(endpoint.path_specs[1].path, "/"); |
| 763 | assert_eq!(endpoint.path_specs[2].path, "/"); |
| 764 | } |
| 765 | |
| 766 | #[test] |
| 767 | fn test_path_param_validation() { |
nothing calls this directly
no test coverage detected