PLT-6271 Changed word splitting to initially split on any non-name character (#6261)

* PLT-6271 Changed word splitting to initially split on any non-name character

* Fixed detection of out of channel mentions
Этот коммит содержится в:
Harrison Healey
2017-04-28 10:13:07 -04:00
коммит произвёл Christopher Speller
родитель 83bfd95f65
Коммит c3e17da8c8
4 изменённых файлов: 38 добавлений и 36 удалений

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

@@ -168,40 +168,38 @@ func TestGetExplicitMentionsAtHere(t *testing.T) {
"here": false,
"@here": true,
" @here ": true,
"\t@here\t": true,
"\n@here\n": true,
// "!@here!": true,
// "@@here@": true,
// "#@here#": true,
// "$@here$": true,
// "%@here%": true,
// "^@here^": true,
// "&@here&": true,
// "*@here*": true,
"(@here(": true,
")@here)": true,
// "-@here-": true,
// "_@here_": true,
// "=@here=": true,
"!@here!": true,
"#@here#": true,
"$@here$": true,
"%@here%": true,
"^@here^": true,
"&@here&": true,
"*@here*": true,
"(@here(": true,
")@here)": true,
"-@here-": true,
"_@here_": false, // This case shouldn't mention since it would be mentioning "@here_"
"=@here=": true,
"+@here+": true,
"[@here[": true,
"{@here{": true,
"]@here]": true,
"}@here}": true,
"\\@here\\": true,
// "|@here|": true,
";@here;": true,
":@here:": true,
// "'@here'": true,
// "\"@here\"": true,
",@here,": true,
"<@here<": true,
".@here.": true,
">@here>": true,
"/@here/": true,
"?@here?": true,
// "`@here`": true,
// "~@here~": true,
"|@here|": true,
";@here;": true,
":@here:": true,
"'@here'": true,
"\"@here\"": true,
",@here,": true,
"<@here<": true,
".@here.": true,
">@here>": true,
"/@here/": true,
"?@here?": true,
"`@here`": false, // This case shouldn't mention since it's a code block
"~@here~": true,
}
for message, shouldMention := range cases {