implement a send command for remove commands

Mentioned in #36.
This commit is contained in:
Gokcehan committed 2016-11-06 17:06:25 +03:00
1 parent d622e74c51
commit a2cc32c908
4 files changed
+77 -11

No files matched your search

+24
View File
@@ -91,6 +91,30 @@ func TestRuneSliceWidthRange(t *testing.T) {
}
}
func TestSplitWord(t *testing.T) {
strs := []struct {
s string
word string
rest string
}{
{"", "", ""},
{"foo", "foo", ""},
{" foo", "foo", ""},
{"foo ", "foo", ""},
{" foo ", "foo", ""},
{"foo bar baz", "foo", "bar baz"},
{" foo bar baz", "foo", "bar baz"},
{"foo bar baz", "foo", "bar baz"},
{" foo bar baz", "foo", "bar baz"},
}
for _, str := range strs {
if w, r := splitWord(str.s); w != str.word || r != str.rest {
t.Errorf("at input '%s' expected '%s' and '%s' but got '%s' and '%s'", str.s, str.word, str.rest, w, r)
}
}
}
func TestHumanize(t *testing.T) {
nums := []struct {
i int64