ref: ae15ff0968856d3a18ee08b7d9970a9218106755
parent: 44186c6af19fc309fb7766fca92527a8585bc7e2
author: spf13 <[email protected]>
date: Sat Jan 18 16:26:34 EST 2014
Fixing test which erroneously checked values and order, rather than just values.
--- a/hugolib/indexing_test.go
+++ b/hugolib/indexing_test.go
@@ -1,16 +1,18 @@
package hugolib
import (
- "strings"
- "testing"
+ "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)
- }
+ 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"}) {
+ if !compareStringSlice(indexes, []string{"categories", "tags"}) {
+ t.Fatalf("possible indexes do not match [tags categories]. Got: %s", indexes)
+ }
+ }
}