mirror of
https://github.com/gohugoio/hugo.git
synced 2024-12-25 14:20:52 +00:00
19 lines
521 B
Go
19 lines
521 B
Go
|
package hugolib
|
||
|
|
||
|
import (
|
||
|
"strings"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestSitePossibleTaxonomies(t *testing.T) {
|
||
|
site := new(Site)
|
||
|
page, _ := ReadFrom(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)
|
||
|
}
|
||
|
}
|
||
|
}
|