Files
website/app/internal/gallery/path_test.go
jimmy 509e7ccb43 Add Technical Kiwi website with Go, templ, and HTMX.
Single-page site with gallery by album and event, contact form over SMTP,
Docker dev/prod setup, and on-server image derivatives. Gallery photos stay
local (app/images/ is gitignored).

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-25 23:57:59 +12:00

23 lines
530 B
Go

package gallery
import "testing"
func TestCollectionFromRel(t *testing.T) {
rel := "templeoftechno/Anniversary-20251105T063538Z-1-001/Anniversary/photo.jpg"
key, label := collectionFromRel(rel)
if label != "Anniversary" {
t.Fatalf("label=%q", label)
}
if key != "anniversary" {
t.Fatalf("key=%q", key)
}
}
func TestURLPath_spaces(t *testing.T) {
got := URLPath("templeoftechno/The Groovatory/foo.jpg")
want := "templeoftechno/The%20Groovatory/foo.jpg"
if got != want {
t.Fatalf("got %q want %q", got, want)
}
}