package gallery import "testing" func TestSelectHero_configured(t *testing.T) { t.Setenv("HERO_IMAGE", "connectionmachine/20220723_231556.jpg") images := []Image{ {RelPath: "templeoftechno/IMG_20250817_020719.jpg"}, {RelPath: "connectionmachine/20220723_231556.jpg", HeroURL: "/images/hero/connectionmachine/20220723_231556.jpg"}, } hero, ok := SelectHero(images) if !ok || hero.RelPath != "connectionmachine/20220723_231556.jpg" { t.Fatalf("got %+v ok=%v", hero, ok) } } func TestParseDate_20220723(t *testing.T) { tm, year := parseDate("20220723_231556.jpg") if tm.IsZero() || year != 2022 { t.Fatalf("got %v year=%d", tm, year) } }