summaryrefslogtreecommitdiff
path: root/indexers/pikdex/hydrate_test.go
blob: 72ac8ead517dd7046ceb715e610afce33e1cb858 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//go:build test

package pikdex

import (
	"github.com/stretchr/testify/assert"
	"pik/runner"
	"testing"
)

func TestHydrate(t *testing.T) {
	aliases := []string{"alias1", "alias2"}
	p := pikdex{
		mods: map[string]*SourceData{
			"asdf": {
				Aliases: aliases,
				Icon:    "I",
				Path:    "asdf",
			},
		},
	}
	src := runner.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)
}