Skip to content

Commit 09813b2

Browse files
committed
emoji test [nfc]: Pull matchesNames up to wider scope
1 parent a077e9a commit 09813b2

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

test/model/emoji_test.dart

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -320,8 +320,12 @@ void main() {
320320
emojiUnicode: tryParseEmojiCodeToUnicode(emojiCode)!));
321321
}
322322

323+
bool matchesNames(String query, List<String> names) {
324+
return EmojiAutocompleteQuery(query).matches(unicode(names));
325+
}
326+
323327
bool matchesName(String query, String emojiName) {
324-
return EmojiAutocompleteQuery(query).matches(unicode([emojiName]));
328+
return matchesNames(query, [emojiName]);
325329
}
326330

327331
test('one-word query matches anywhere in name', () {
@@ -370,10 +374,6 @@ void main() {
370374
});
371375

372376
test('query matches aliases same way as primary name', () {
373-
bool matchesNames(String query, List<String> names) {
374-
return EmojiAutocompleteQuery(query).matches(unicode(names));
375-
}
376-
377377
check(matchesNames('a', ['a', 'b'])).isTrue();
378378
check(matchesNames('b', ['a', 'b'])).isTrue();
379379
check(matchesNames('c', ['a', 'b'])).isFalse();

0 commit comments

Comments
 (0)