diff options
| author | ewy <ewy0@protonmail.com> | 2026-04-22 21:33:01 +0200 |
|---|---|---|
| committer | ewy <ewy0@protonmail.com> | 2026-04-22 21:33:01 +0200 |
| commit | 059f7c703dc9138e6217528805874811304882ac (patch) | |
| tree | 7e6823f703630b7b318c2193356d6a52b15b4b4e /indexers | |
| parent | b976d31f41312f711eb537e051fd12efc0b9d14a (diff) | |
add unit test for pikdex hydration
Diffstat (limited to 'indexers')
| -rw-r--r-- | indexers/pikdex/hydrate_test.go | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/indexers/pikdex/hydrate_test.go b/indexers/pikdex/hydrate_test.go new file mode 100644 index 0000000..e72954e --- /dev/null +++ b/indexers/pikdex/hydrate_test.go @@ -0,0 +1,29 @@ +//go:build test + +package pikdex + +import ( + "github.com/stretchr/testify/assert" + "pik/testx" + "testing" +) + +func TestHydrate(t *testing.T) { + aliases := []string{"alias1", "alias2"} + p := pikdex{ + mods: map[string]*SourceData{ + "asdf": { + Aliases: aliases, + Icon: "I", + Path: "asdf", + }, + }, + } + src := testx.TSource("asdf", "target") + hyd := src.Hydrate(nil) + assert.NotNil(t, hyd) + err := p.Mod(src, hyd) + assert.NoError(t, err) + assert.Equal(t, aliases, hyd.Aliases) + assert.Equal(t, "I", hyd.Icon) +} |
