From 5863c176146bebb535e0c8d66bae34b74b419469 Mon Sep 17 00:00:00 2001 From: Greg Price Date: Sat, 7 Dec 2024 18:00:59 -0800 Subject: [PATCH] emoji test [nfc]: Pull matchesNames up to wider scope --- test/model/emoji_test.dart | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/model/emoji_test.dart b/test/model/emoji_test.dart index 41b2b5ced3..9ad49ba2e2 100644 --- a/test/model/emoji_test.dart +++ b/test/model/emoji_test.dart @@ -283,8 +283,12 @@ void main() { emojiUnicode: tryParseEmojiCodeToUnicode(emojiCode)!)); } + bool matchesNames(String query, List 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', () { @@ -333,10 +337,6 @@ void main() { }); test('query matches aliases same way as primary name', () { - bool matchesNames(String query, List 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();