[MM-36481] Fix emoji regex to support thumbsup (#17846)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
ec8aaec5ce
Коммит
f8fc5190ee
@@ -476,6 +476,84 @@ func TestIsValidAlphaNumHyphenUnderscore(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsValidAlphaNumHyphenUnderscorePlus(t *testing.T) {
|
||||
cases := []struct {
|
||||
Input string
|
||||
Result bool
|
||||
}{
|
||||
{
|
||||
Input: "test",
|
||||
Result: true,
|
||||
},
|
||||
{
|
||||
Input: "test+name",
|
||||
Result: true,
|
||||
},
|
||||
{
|
||||
Input: "test+-name",
|
||||
Result: true,
|
||||
},
|
||||
{
|
||||
Input: "test_+name",
|
||||
Result: true,
|
||||
},
|
||||
{
|
||||
Input: "test++name",
|
||||
Result: true,
|
||||
},
|
||||
{
|
||||
Input: "test_-name",
|
||||
Result: true,
|
||||
},
|
||||
{
|
||||
Input: "-",
|
||||
Result: true,
|
||||
},
|
||||
{
|
||||
Input: "_",
|
||||
Result: true,
|
||||
},
|
||||
{
|
||||
Input: "+",
|
||||
Result: true,
|
||||
},
|
||||
{
|
||||
Input: "test+",
|
||||
Result: true,
|
||||
},
|
||||
{
|
||||
Input: "test++",
|
||||
Result: true,
|
||||
},
|
||||
{
|
||||
Input: "test--",
|
||||
Result: true,
|
||||
},
|
||||
{
|
||||
Input: "test__",
|
||||
Result: true,
|
||||
},
|
||||
{
|
||||
Input: ".",
|
||||
Result: false,
|
||||
},
|
||||
|
||||
{
|
||||
Input: "test,",
|
||||
Result: false,
|
||||
},
|
||||
{
|
||||
Input: "test:name",
|
||||
Result: false,
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range cases {
|
||||
actual := IsValidAlphaNumHyphenUnderscorePlus(tc.Input)
|
||||
require.Equalf(t, actual, tc.Result, "case: '%v'\tshould returned: %#v", tc.Input, tc.Result)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIsValidId(t *testing.T) {
|
||||
cases := []struct {
|
||||
Input string
|
||||
|
||||
Ссылка в новой задаче
Block a user