From b28d1cc48794019e63b95b197a6b9cd3fe64275c Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Fri, 3 Oct 2014 17:55:26 +0900 Subject: 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 --- .../latin/makedict/BinaryDictDecoderEncoderTests.java | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'tests/src/com/android/inputmethod/latin/makedict/BinaryDictDecoderEncoderTests.java') 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 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 bigram = new Pair<>(word0, word1); + assertTrue(bigramSet.contains(bigram)); + bigramSet.remove(bigram); + } } token = result.mNextToken; } while (token != 0); -- cgit v1.2.3-83-g751a