feat(ingestion): add wiki package with Page types and slug generation
This commit is contained in:
29
ingestion/internal/wiki/slug_test.go
Normal file
29
ingestion/internal/wiki/slug_test.go
Normal 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))
|
||||
})
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user