fix comments inside quotes in colors/icons files
This commit is contained in:
1 parent
17453f10f5
commit
3e3a4a6386
2 files changed
+44
-10
No files matched your search
@@ -3,6 +3,7 @@ package main
|
||||
import (
|
||||
"os"
|
||||
"reflect"
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
@@ -165,6 +166,28 @@ func TestSplitWord(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestReadPairs(t *testing.T) {
|
||||
tests := []struct {
|
||||
s string
|
||||
exp [][]string
|
||||
}{
|
||||
{"foo bar", [][]string{[]string{"foo", "bar"}}},
|
||||
{"foo bar ", [][]string{[]string{"foo", "bar"}}},
|
||||
{" foo bar", [][]string{[]string{"foo", "bar"}}},
|
||||
{" foo bar ", [][]string{[]string{"foo", "bar"}}},
|
||||
{"foo bar#baz", [][]string{[]string{"foo", "bar"}}},
|
||||
{"foo bar #baz", [][]string{[]string{"foo", "bar"}}},
|
||||
{`'foo#baz' bar`, [][]string{[]string{"foo#baz", "bar"}}},
|
||||
{`"foo#baz" bar`, [][]string{[]string{"foo#baz", "bar"}}},
|
||||
}
|
||||
|
||||
for _, test := range tests {
|
||||
if got, _ := readPairs(strings.NewReader(test.s)); !reflect.DeepEqual(got, test.exp) {
|
||||
t.Errorf("at input '%v' expected '%v' but got '%v'", test.s, test.exp, got)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestHumanize(t *testing.T) {
|
||||
tests := []struct {
|
||||
i int64
|
||||
|
||||
Reference in new issue
Block a user