@@ -425,37 +425,39 @@ void main() {
425
425
'1f3f3' )).none;
426
426
});
427
427
428
- test ('can match realm emoji' , () {
429
- EmojiCandidate realmCandidate (String emojiName) {
430
- return EmojiCandidate (
431
- emojiType: ReactionType .realmEmoji,
432
- emojiCode: '1' , emojiName: emojiName, aliases: null ,
433
- emojiDisplay: ImageEmojiDisplay (
434
- emojiName: emojiName,
435
- resolvedUrl: eg.realmUrl.resolve ('/emoji/1.png' ),
436
- resolvedStillUrl: eg.realmUrl.resolve ('/emoji/1-still.png' )));
437
- }
428
+ EmojiCandidate realmCandidate (String emojiName) {
429
+ return EmojiCandidate (
430
+ emojiType: ReactionType .realmEmoji,
431
+ emojiCode: '1' , emojiName: emojiName, aliases: null ,
432
+ emojiDisplay: ImageEmojiDisplay (
433
+ emojiName: emojiName,
434
+ resolvedUrl: eg.realmUrl.resolve ('/emoji/1.png' ),
435
+ resolvedStillUrl: eg.realmUrl.resolve ('/emoji/1-still.png' )));
436
+ }
438
437
438
+ test ('can match realm emoji' , () {
439
439
check (matchOf ('eqeq' , realmCandidate ('eqeq' ))).exact;
440
440
check (matchOf ('open_' , realmCandidate ('open_book' ))).prefix;
441
441
check (matchOf ('n_b' , realmCandidate ('open_book' ))).none;
442
442
check (matchOf ('blue dia' , realmCandidate ('large_blue_diamond' ))).other;
443
443
check (matchOf ('Smi' , realmCandidate ('smile' ))).prefix;
444
444
});
445
445
446
- test ( 'can match Zulip extra emoji' , () {
446
+ EmojiCandidate zulipCandidate () {
447
447
final store = eg.store ();
448
- final zulipCandidate = EmojiCandidate (
448
+ return EmojiCandidate (
449
449
emojiType: ReactionType .zulipExtraEmoji,
450
450
emojiCode: 'zulip' , emojiName: 'zulip' , aliases: null ,
451
451
emojiDisplay: store.emojiDisplayFor (
452
452
emojiType: ReactionType .zulipExtraEmoji,
453
453
emojiCode: 'zulip' , emojiName: 'zulip' ));
454
+ }
454
455
455
- check (matchOf ('z' , zulipCandidate)).prefix;
456
- check (matchOf ('Zulip' , zulipCandidate)).exact;
457
- check (matchOf ('p' , zulipCandidate)).other;
458
- check (matchOf ('x' , zulipCandidate)).none;
456
+ test ('can match Zulip extra emoji' , () {
457
+ check (matchOf ('z' , zulipCandidate ())).prefix;
458
+ check (matchOf ('Zulip' , zulipCandidate ())).exact;
459
+ check (matchOf ('p' , zulipCandidate ())).other;
460
+ check (matchOf ('x' , zulipCandidate ())).none;
459
461
});
460
462
461
463
int ? rankOf (String query, EmojiCandidate candidate) {
0 commit comments