@@ -462,37 +462,39 @@ void main() {
462
462
'1f3f3' )).none;
463
463
});
464
464
465
- test ('can match realm emoji' , () {
466
- EmojiCandidate realmCandidate (String emojiName) {
467
- return EmojiCandidate (
468
- emojiType: ReactionType .realmEmoji,
469
- emojiCode: '1' , emojiName: emojiName, aliases: null ,
470
- emojiDisplay: ImageEmojiDisplay (
471
- emojiName: emojiName,
472
- resolvedUrl: eg.realmUrl.resolve ('/emoji/1.png' ),
473
- resolvedStillUrl: eg.realmUrl.resolve ('/emoji/1-still.png' )));
474
- }
465
+ EmojiCandidate realmCandidate (String emojiName) {
466
+ return EmojiCandidate (
467
+ emojiType: ReactionType .realmEmoji,
468
+ emojiCode: '1' , emojiName: emojiName, aliases: null ,
469
+ emojiDisplay: ImageEmojiDisplay (
470
+ emojiName: emojiName,
471
+ resolvedUrl: eg.realmUrl.resolve ('/emoji/1.png' ),
472
+ resolvedStillUrl: eg.realmUrl.resolve ('/emoji/1-still.png' )));
473
+ }
475
474
475
+ test ('can match realm emoji' , () {
476
476
check (matchOf ('eqeq' , realmCandidate ('eqeq' ))).exact;
477
477
check (matchOf ('open_' , realmCandidate ('open_book' ))).prefix;
478
478
check (matchOf ('n_b' , realmCandidate ('open_book' ))).none;
479
479
check (matchOf ('blue dia' , realmCandidate ('large_blue_diamond' ))).other;
480
480
check (matchOf ('Smi' , realmCandidate ('smile' ))).prefix;
481
481
});
482
482
483
- test ( 'can match Zulip extra emoji' , () {
483
+ EmojiCandidate zulipCandidate () {
484
484
final store = eg.store ();
485
- final zulipCandidate = EmojiCandidate (
485
+ return EmojiCandidate (
486
486
emojiType: ReactionType .zulipExtraEmoji,
487
487
emojiCode: 'zulip' , emojiName: 'zulip' , aliases: null ,
488
488
emojiDisplay: store.emojiDisplayFor (
489
489
emojiType: ReactionType .zulipExtraEmoji,
490
490
emojiCode: 'zulip' , emojiName: 'zulip' ));
491
+ }
491
492
492
- check (matchOf ('z' , zulipCandidate)).prefix;
493
- check (matchOf ('Zulip' , zulipCandidate)).exact;
494
- check (matchOf ('p' , zulipCandidate)).other;
495
- check (matchOf ('x' , zulipCandidate)).none;
493
+ test ('can match Zulip extra emoji' , () {
494
+ check (matchOf ('z' , zulipCandidate ())).prefix;
495
+ check (matchOf ('Zulip' , zulipCandidate ())).exact;
496
+ check (matchOf ('p' , zulipCandidate ())).other;
497
+ check (matchOf ('x' , zulipCandidate ())).none;
496
498
});
497
499
498
500
int ? rankOf (String query, EmojiCandidate candidate) {
0 commit comments