diff options
author | Cameron Moore <moorereason@gmail.com> | 2016-12-26 19:42:43 -0600 |
---|---|---|
committer | Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com> | 2016-12-27 11:19:25 +0100 |
commit | d1b89f5c7cb3d1031d74014b4b2150a434bf557e (patch) | |
tree | 9ac628caca272ef9cdc0edca7fb0496dbd32a28b /hugolib/page_taxonomy_test.go | |
parent | 17f851780c79d0223b247dadcd8ddec0c74c4500 (diff) |
hugolib: Use reflect.DeepEqual in tests
Diffstat (limited to 'hugolib/page_taxonomy_test.go')
-rw-r--r-- | hugolib/page_taxonomy_test.go | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/hugolib/page_taxonomy_test.go b/hugolib/page_taxonomy_test.go index 30efd8c7f..acb6c28f1 100644 --- a/hugolib/page_taxonomy_test.go +++ b/hugolib/page_taxonomy_test.go @@ -14,6 +14,7 @@ package hugolib import ( + "reflect" "strings" "testing" ) @@ -73,7 +74,7 @@ func TestParseTaxonomies(t *testing.T) { if params, ok := param.([]string); ok { expected := []string{"a", "b", "c"} - if !compareStringSlice(params, expected) { + if !reflect.DeepEqual(params, expected) { t.Errorf("Expected %s: got: %s", expected, params) } } else if params, ok := param.(string); ok { @@ -91,17 +92,3 @@ func TestParseTaxonomies(t *testing.T) { } } } - -func compareStringSlice(a, b []string) bool { - if len(a) != len(b) { - return false - } - - for i, v := range a { - if b[i] != v { - return false - } - } - - return true -} |