()
| 689 | |
| 690 | #[test] |
| 691 | fn test_multiple_methods_single_path() { |
| 692 | let input = r#" |
| 693 | route /api { |
| 694 | get /, post / { |
| 695 | return "hello"; |
| 696 | } |
| 697 | } |
| 698 | "#; |
| 699 | |
| 700 | let mut parser = Parser::new(input); |
| 701 | let result = parser.parse_route().unwrap(); |
| 702 | |
| 703 | assert_eq!(result.prefix, "/api"); |
| 704 | assert_eq!(result.endpoints.len(), 1); |
| 705 | |
| 706 | let endpoint = &result.endpoints[0]; |
| 707 | assert_eq!(endpoint.path_specs.len(), 2); |
| 708 | assert_eq!(endpoint.path_specs[0].method, HttpMethod::Get); |
| 709 | assert_eq!(endpoint.path_specs[0].path, "/"); |
| 710 | assert_eq!(endpoint.path_specs[1].method, HttpMethod::Post); |
| 711 | assert_eq!(endpoint.path_specs[1].path, "/"); |
| 712 | } |
| 713 | |
| 714 | #[test] |
| 715 | #[ignore = "temporary ignore"] |
nothing calls this directly
no test coverage detected