Skip to content

Commit ac02147

Browse files
committed
test [nfc]: Remove the assert from serverEmojiDataPopularPlus
The assert was for not letting the coming emoji data collide with popular emoji data. This change will make it easier for callers to provide data of any emojis. If the data contains one/more of popular emojis, the data from serverEmojiDataPopular will replace it, as it is the source of truth for popular emojis in test code.
1 parent 9284a6e commit ac02147

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

test/example_data.dart

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -166,16 +166,9 @@ final ServerEmojiData serverEmojiDataPopular = _immutableServerEmojiData(codeToN
166166
});
167167

168168
ServerEmojiData serverEmojiDataPopularPlus(ServerEmojiData data) {
169-
final a = serverEmojiDataPopular;
170-
final b = data;
171-
final result = ServerEmojiData(
172-
codeToNames: {...a.codeToNames, ...b.codeToNames},
173-
);
174-
assert(
175-
result.codeToNames.length == a.codeToNames.length + b.codeToNames.length,
176-
'eg.serverEmojiDataPopularPlus called with data that collides with eg.serverEmojiDataPopular',
169+
return ServerEmojiData(
170+
codeToNames: {...data.codeToNames, ...serverEmojiDataPopular.codeToNames},
177171
);
178-
return result;
179172
}
180173

181174
/// Like [serverEmojiDataPopular], but with the legacy '1f642': ['smile']

0 commit comments

Comments
 (0)