MCPcopy Create free account
hub / github.com/aiscriptdev/aiscript / test_empty_paths

Function test_empty_paths

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

Source from the content-addressed store, hash-verified

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() {

Callers

nothing calls this directly

Calls 1

parse_routeMethod · 0.80

Tested by

no test coverage detected