aboutsummaryrefslogtreecommitdiffstats
path: root/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java
diff options
context:
space:
mode:
authorJean Chalard <jchalard@google.com>2014-10-03 17:55:26 +0900
committerJean Chalard <jchalard@google.com>2014-10-03 18:04:10 +0900
commitb28d1cc48794019e63b95b197a6b9cd3fe64275c (patch)
tree1748de94e7b45f8065beef1bd366982ea98e3ea5 /tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java
parentfb051c3957ae17061204b06258aec3b2e0f05034 (diff)
downloadlatinime-b28d1cc48794019e63b95b197a6b9cd3fe64275c.tar.gz
latinime-b28d1cc48794019e63b95b197a6b9cd3fe64275c.tar.xz
latinime-b28d1cc48794019e63b95b197a6b9cd3fe64275c.zip
Fix a behavior change in dicttool
The behavior change was introduced by I8b3458ad. Concretely, empty bigram lists would end up as empty lists instead of null. Change-Id: Ibcdf7e6aabc6aba3f5db0477335882394e050ce5
Diffstat (limited to 'tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java')
-rw-r--r--tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java12
1 files changed, 7 insertions, 5 deletions
diff --git a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java
index 215c9ddc7..201b8bb77 100644
--- a/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java
+++ b/tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java
@@ -715,11 +715,13 @@ public class BinaryDictDecoderEncoderTests extends AndroidTestCase {
}
assertTrue(shortcutList.isEmpty());
}
- for (final WeightedString bigramTarget : wordProperty.getBigrams()) {
- final String word1 = bigramTarget.mWord;
- final Pair<String, String> bigram = new Pair<>(word0, word1);
- assertTrue(bigramSet.contains(bigram));
- bigramSet.remove(bigram);
+ if (wordProperty.mHasNgrams) {
+ for (final WeightedString bigramTarget : wordProperty.getBigrams()) {
+ final String word1 = bigramTarget.mWord;
+ final Pair<String, String> bigram = new Pair<>(word0, word1);
+ assertTrue(bigramSet.contains(bigram));
+ bigramSet.remove(bigram);
+ }
}
token = result.mNextToken;
} while (token != 0);