()
| 556 | |
| 557 | #[test] |
| 558 | fn test_no_top_route() { |
| 559 | let input = r#" |
| 560 | get / { |
| 561 | return "hello"; |
| 562 | } |
| 563 | |
| 564 | post / { |
| 565 | return "hello"; |
| 566 | } |
| 567 | "#; |
| 568 | let mut parser = Parser::new(input); |
| 569 | let result = parser.parse_route(); |
| 570 | // assert!(result.is_ok()); |
| 571 | let route = result.unwrap(); |
| 572 | assert_eq!(route.endpoints.len(), 2); |
| 573 | assert_eq!(route.endpoints[0].path_specs[0].method, HttpMethod::Get); |
| 574 | assert_eq!(route.endpoints[1].path_specs[0].method, HttpMethod::Post); |
| 575 | assert_eq!(route.endpoints[0].path_specs[0].path, "/"); |
| 576 | assert_eq!(route.endpoints[1].path_specs[0].path, "/"); |
| 577 | } |
| 578 | |
| 579 | #[test] |
| 580 | fn test_multiple_methods() { |
nothing calls this directly
no test coverage detected