Skip to content

Commit

Permalink
emoji test [nfc]: Pull matchesNames up to wider scope
Browse files Browse the repository at this point in the history
  • Loading branch information
gnprice committed Dec 8, 2024
1 parent 2177758 commit 5863c17
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions test/model/emoji_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,12 @@ void main() {
emojiUnicode: tryParseEmojiCodeToUnicode(emojiCode)!));
}

bool matchesNames(String query, List<String> names) {
return EmojiAutocompleteQuery(query).matches(unicode(names));
}

bool matchesName(String query, String emojiName) {
return EmojiAutocompleteQuery(query).matches(unicode([emojiName]));
return matchesNames(query, [emojiName]);
}

test('one-word query matches anywhere in name', () {
Expand Down Expand Up @@ -333,10 +337,6 @@ void main() {
});

test('query matches aliases same way as primary name', () {
bool matchesNames(String query, List<String> names) {
return EmojiAutocompleteQuery(query).matches(unicode(names));
}

check(matchesNames('a', ['a', 'b'])).isTrue();
check(matchesNames('b', ['a', 'b'])).isTrue();
check(matchesNames('c', ['a', 'b'])).isFalse();
Expand Down

0 comments on commit 5863c17

Please sign in to comment.