fix tags not being in lowercase, #491

This commit is contained in:
Joel Scoble
2014-09-09 15:58:02 -05:00
committed by spf13
parent 012a473e27
commit 4e9b04086a
3 changed files with 43 additions and 9 deletions

View File

@@ -40,7 +40,7 @@ Leading
{
"title": "spf13-vim 3.0 release and new website",
"description": "spf13-vim is a cross platform distribution of vim plugins and resources for Vim.",
"tags": [ ".vimrc", "plugins", "spf13-vim", "vim" ],
"tags": [ ".vimrc", "plugins", "spf13-vim", "VIm" ],
"date": "2012-04-06",
"categories": [
"Development",
@@ -55,7 +55,7 @@ Content of the file goes Here
{
"title": "spf13-vim 3.0 release and new website"
"description": "spf13-vim is a cross platform distribution of vim plugins and resources for Vim."
"tags": [ ".vimrc", "plugins", "spf13-vim", "vim" ]
"tags": [ ".vimrc", "plugins", "spf13-vim", "VIm" ]
"date": "2012-04-06"
"categories": [
"Development"
@@ -565,6 +565,26 @@ func TestLayoutOverride(t *testing.T) {
}
}
func TestSliceToLower(t *testing.T) {
tests := []struct{
value []string
expected []string
}{
{[]string{"a","b","c"}, []string{"a", "b", "c"}},
{[]string{"a","B","c"}, []string{"a", "b", "c"}},
{[]string{"A","B","C"}, []string{"a", "b", "c"}},
}
for _, test := range tests {
res := sliceToLower(test.value)
for i, val := range res {
if val != test.expected[i] {
t.Errorf("Case mismatch. Expected %s, got %s", test.expected[i], res[i])
}
}
}
}
func listEqual(left, right []string) bool {
if len(left) != len(right) {
return false