MCPcopy Index your code
hub / github.com/aiscriptdev/aiscript / test_multiple_methods_single_path

Function test_multiple_methods_single_path

aiscript-runtime/src/parser.rs:691–712  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

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"]

Callers

nothing calls this directly

Calls 1

parse_routeMethod · 0.80

Tested by

no test coverage detected