fix comments inside quotes in colors/icons files

This commit is contained in:
Gokcehan committed 2022-02-13 23:25:03 +03:00
1 parent 17453f10f5
commit 3e3a4a6386
2 files changed
+44 -10

No files matched your search

+23
View File
@@ -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