mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Fix NPE in a unit test.
Change-Id: I0dfc23232ed77e1ff1aedecfa6ac022020cb1c19
This commit is contained in:
parent
65e3ae6f15
commit
d77ad1902b
@ -993,6 +993,10 @@ public class BinaryDictionaryTests extends AndroidTestCase {
|
|||||||
for (final String word : words) {
|
for (final String word : words) {
|
||||||
final UnigramProperty unigramProperty = binaryDictionary.getUnigramProperty(word);
|
final UnigramProperty unigramProperty = binaryDictionary.getUnigramProperty(word);
|
||||||
assertEquals((int)unigramProbabilities.get(word), unigramProperty.mProbability);
|
assertEquals((int)unigramProbabilities.get(word), unigramProperty.mProbability);
|
||||||
|
if (!shortcutTargets.containsKey(word)) {
|
||||||
|
// The word does not have shortcut targets.
|
||||||
|
continue;
|
||||||
|
}
|
||||||
assertEquals(shortcutTargets.get(word).size(), unigramProperty.mShortcutTargets.size());
|
assertEquals(shortcutTargets.get(word).size(), unigramProperty.mShortcutTargets.size());
|
||||||
for (final WeightedString shortcutTarget : unigramProperty.mShortcutTargets) {
|
for (final WeightedString shortcutTarget : unigramProperty.mShortcutTargets) {
|
||||||
final String targetCodePonts = shortcutTarget.mWord;
|
final String targetCodePonts = shortcutTarget.mWord;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user