Welcome to mirror list, hosted at ThFree Co, Russian Federation.

taxonomy_test.go « hugolib - github.com/gohugoio/hugo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7f245d0a916b338611132fabc49ae640dbb685fc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
package hugolib

import (
	"strings"
	"testing"
)

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