almost all ready

This commit is contained in:
2026-05-14 01:48:15 +02:00
parent 1b53c1c199
commit 2e1bec0e8b
29 changed files with 5442 additions and 642 deletions
@@ -0,0 +1,25 @@
package routes
import "testing"
func TestCategoryRouteDoesNotOwnImagePath(t *testing.T) {
route, err := CompileCategoryRoute("/{id}-{rewrite}")
if err != nil {
t.Fatalf("compile category route: %v", err)
}
if match, ok := route.MatchInfo("/img/p/1/1/9/6/1/2/119612-large_default.webp"); ok || match != nil {
t.Fatalf("expected image path to bypass category route, got ok=%v match=%+v", ok, match)
}
}
func TestProductRouteDoesNotOwnImagePath(t *testing.T) {
route, err := CompileProductRoute("/{id}-{rewrite}")
if err != nil {
t.Fatalf("compile product route: %v", err)
}
if match, ok := route.MatchInfo("/img/p/1/1/9/6/1/2/119612-large_default.webp"); ok || match != nil {
t.Fatalf("expected image path to bypass product route, got ok=%v match=%+v", ok, match)
}
}