2014-04-09 03:15:57 +00:00
|
|
|
package hugolib
|
|
|
|
|
|
|
|
import (
|
|
|
|
"strings"
|
|
|
|
"testing"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestSitePossibleTaxonomies(t *testing.T) {
|
|
|
|
site := new(Site)
|
2014-05-01 18:11:56 +00:00
|
|
|
page, _ := NewPageFrom(strings.NewReader(PAGE_YAML_WITH_TAXONOMIES_A), "path/to/page")
|
2014-04-09 03:15:57 +00:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|