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

Function test_multiple_methods

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

Source from the content-addressed store, hash-verified

578
579 #[test]
580 fn test_multiple_methods() {
581 let input = r#"
582 route /api {
583 get /, post / {
584 return "hello";
585 }
586 }
587 "#;
588
589 let mut parser = Parser::new(input);
590 let result = parser.parse_route();
591 // assert!(result.is_ok());
592
593 let route = result.unwrap();
594 let endpoint = &route.endpoints[0];
595 assert_eq!(endpoint.path_specs.len(), 2);
596 assert_eq!(endpoint.path_specs[0].method, HttpMethod::Get);
597 assert_eq!(endpoint.path_specs[1].method, HttpMethod::Post);
598 }
599
600 #[test]
601 fn test_validators() {

Callers

nothing calls this directly

Calls 1

parse_routeMethod · 0.80

Tested by

no test coverage detected