Files
workout-suggester/internal/web/views/helpers_test.go
T
bdeb1337 d7342d6096 feat: workout-suggester, weather-aware workouts from a local Gemma
Go + Templ + HTMX app that checks the weather (Open-Meteo, MET Norway
fallback), scores run/ride/walk with plain rules, and has a local
open-weight model (Gemma 4 E2B via any OpenAI-compatible server) write
the plan. Routes are loops from your door (BRouter) plus signposted
OpenStreetMap routes (Overpass), with GPX export.
2026-10-11 19:29:58 +02:00

22 lines
602 B
Go

package views
import (
"bytes"
"context"
"strings"
"testing"
)
func TestMarkdownSections(t *testing.T) {
var buf bytes.Buffer
src := "**Go for a run**: nice.\n**When:** now\n**The session:**\n- warm up\n- run\n**Route:** the loop"
Markdown(src).Render(context.Background(), &buf)
got := buf.String()
if strings.Contains(got, "run\n<strong>Route:") || !strings.Contains(got, "</ul>\n<p><strong>Route:</strong>") {
t.Errorf("Route folded into the list:\n%s", got)
}
if !strings.Contains(got, "<p><strong>Go for a run</strong>: nice.</p>") {
t.Errorf("first line mangled:\n%s", got)
}
}