INNER CODE UNIT · Rust
it_creates_catch_all_route
vercel-community/rust · crates/vercel_runtime_router/src/lib.rs:354
fn it_creates_catch_all_route() {
let path = "api/[...all]";
let route = Route::from(path);
assert!(matches!(route.kind, RouteKind::CatchAll));
assert_eq!(route.path, path);
assert!(route.segments.is_some());
assert_eq!(route.segments.unwrap(), vec!["api", "[...all]"]);
}
#[test]
fn it_creates_complex_catch_all_route() {
let path = "api/[dyn]/handler/[...all]";
let route = Route::from(path);
assert!(matches!(route.kind, RouteKind::CatchAll));
assert_eq!(route.path, path);
assert!(route.segments.is_some());
assert_eq!(
route.segments.unwrap(),