shithub: hugo

ref: 5374242ff7b6cc1677baf9a1dd2b835d8ee6d18f
dir: /hugolib/indexing_test.go/

View raw version
package hugolib

import (
	"strings"
	"testing"
)

func TestSitePossibleIndexes(t *testing.T) {
	site := new(Site)
	page, _ := ReadFrom(strings.NewReader(PAGE_YAML_WITH_INDEXES_A), "path/to/page")
	site.Pages = append(site.Pages, page)
	indexes := site.possibleIndexes()
	if !compareStringSlice(indexes, []string{"tags", "categories"}) {
		t.Fatalf("possible indexes do not match [tags categories].  Got: %s", indexes)
	}
}