feat(ingestion): add wiki package with Page types and slug generation

This commit is contained in:
Mathias Bergqvist
2026-04-22 22:25:45 +02:00
parent c7341a2607
commit 91e02b930c
3 changed files with 81 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
// ingestion/internal/wiki/slug_test.go
package wiki
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestSlug(t *testing.T) {
tests := []struct {
input string
want string
}{
{"Domain Driven Design", "domain-driven-design"},
{"It's Complicated", "its-complicated"},
{"gRPC", "grpc"},
{"GPT-4o", "gpt-4o"},
{"Property 1: It's Rough", "property-1-its-rough"},
{" leading spaces ", "leading-spaces"},
{"multiple spaces", "multiple-spaces"},
{"already-kebab", "already-kebab"},
}
for _, tc := range tests {
t.Run(tc.input, func(t *testing.T) {
assert.Equal(t, tc.want, Slug(tc.input))
})
}
}