Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Этот коммит содержится в:
Josh Soref
2022-02-28 04:31:00 -05:00
коммит произвёл GitHub
родитель a22bc8fd96
Коммит 5d85417a8b
42 изменённых файлов: 101 добавлений и 101 удалений

Просмотреть файл

@@ -253,7 +253,7 @@ func TestTruncateText(t *testing.T) {
t.Run("Truncates string to 300 + 5", func(t *testing.T) {
assert.Equal(t, utf8.RuneCountInString(truncateText(BigText)), 305, "should be 300 chars + 5")
})
t.Run("Truncated text ends in elipsis", func(t *testing.T) {
t.Run("Truncated text ends in ellipsis", func(t *testing.T) {
assert.True(t, strings.HasSuffix(truncateText(BigText), "[...]"))
})
}

Просмотреть файл

@@ -94,17 +94,17 @@ func TestSplitWords(t *testing.T) {
Output: []string{"\"quoted multiple words\""},
},
{
Name: "string has a mix of qouted words and non quoted words, output should contain 5 entries, quoted words should not be split",
Name: "string has a mix of quoted words and non quoted words, output should contain 5 entries, quoted words should not be split",
Input: "some stuff \"quoted multiple words\" more stuff",
Output: []string{"some", "stuff", "\"quoted multiple words\"", "more", "stuff"},
},
{
Name: "string has a mix of qouted words with a - prefix and non quoted words, output should contain 5 entries, quoted words should not be split, - should be kept",
Name: "string has a mix of quoted words with a - prefix and non quoted words, output should contain 5 entries, quoted words should not be split, - should be kept",
Input: "some stuff -\"quoted multiple words\" more stuff",
Output: []string{"some", "stuff", "-\"quoted multiple words\"", "more", "stuff"},
},
{
Name: "string has a mix of multiple qouted words with a - prefix and non quoted words including a # character, output should contain 5 entries, quoted words should not be split, # and - should be kept",
Name: "string has a mix of multiple quoted words with a - prefix and non quoted words including a # character, output should contain 5 entries, quoted words should not be split, # and - should be kept",
Input: "some \"stuff\" \"quoted multiple words\" #some \"more stuff\"",
Output: []string{"some", "\"stuff\"", "\"quoted multiple words\"", "#some", "\"more stuff\""},
},
@@ -393,7 +393,7 @@ func TestParseSearchFlags2(t *testing.T) {
},
},
{
Name: "string with a non-floag followed by :",
Name: "string with a non-flag followed by :",
Input: "fruit: cherry",
Words: []searchWord{
{
@@ -1418,7 +1418,7 @@ func TestParseSearchParams(t *testing.T) {
},
},
{
Name: "input is a wilrdcar with a *, should result in one term with a *",
Name: "input is a wildcard with a *, should result in one term with a *",
Input: "wildcar*",
Output: []*SearchParams{
{

Просмотреть файл

@@ -107,7 +107,7 @@ func TestMapJson(t *testing.T) {
require.Equal(t, rm["id"], "test_id", "map should be valid")
rm2 := MapFromJSON(strings.NewReader(""))
require.LessOrEqual(t, len(rm2), 0, "make should be ivalid")
require.LessOrEqual(t, len(rm2), 0, "make should be invalid")
}
func TestIsValidEmail(t *testing.T) {
@@ -213,7 +213,7 @@ var hashtags = map[string]string{
"#?test": "",
"#-test": "",
"#yo_yo": "#yo_yo",
"(#brakets)": "#brakets",
"(#brackets)": "#brackets",
")#stekarb(": "#stekarb",
"<#less_than<": "#less_than",
">#greater_than>": "#greater_than",
@@ -885,7 +885,7 @@ func TestIsValidHTTPURL(t *testing.T) {
},
{
"url with invalid scheme",
"htp://mattermost.com",
"http-bad://mattermost.com",
false,
},
{
@@ -905,7 +905,7 @@ func TestIsValidHTTPURL(t *testing.T) {
},
{
"correct url with http scheme",
"http://mattemost.com",
"http://mattermost.com",
true,
},
{