aboutsummaryrefslogtreecommitdiff
path: root/java
diff options
context:
space:
mode:
authorTim Barron <tjbarron@google.com>2021-06-23 13:20:04 -0700
committerTim Barron <tjbarron@google.com>2021-06-23 13:33:58 -0700
commit4d283b778e269315193245d4f6460d17119042e1 (patch)
tree637287af89eeb5568bd0dc1193f2dceb1d5c3b2b /java
parent63545535ac2423e7761dbdf977bd003f21a581e9 (diff)
downloadicing-4d283b778e269315193245d4f6460d17119042e1.tar.gz
Sync from upstream.
Descriptions: ========== Switch DocumentStore to using PortableFileBackedProtoLog instead of FileBackedProtoLog, and migrate any existing FileBackedProtoLog's to the Portable* version. ========== Add more fields to SchemaStats to capture the types that were newly added, modified and modified with an index rebuild. ========== Create a new DeleteByQueryStatsProto to capture query-specific stats related to the performance of DeleteByQuery. ========== Fix bugs in SetSchema: 1. Property id reassignments when a property is deleted and a new one added was not being detected 2. Property id reassignments due to changes to the index_nested_properties field were not detected. 3. Backward incompatible changes should invalidate dependent types. ========== Fix IcingSearchEngineTest.CJKSnippets test by choosing a simpler multi-byte character (when encoded in UTF-8) string that ICU will always segment in the same way regardless of api level. Bug: 185806837 Bug: 187205195 Bug: 187726282 Change-Id: I07cc8bf3fc5b3a7c5e8f0d24d1724297f3bfba5d
Diffstat (limited to 'java')
-rw-r--r--java/tests/instrumentation/src/com/google/android/icing/IcingSearchEngineTest.java19
1 files changed, 10 insertions, 9 deletions
diff --git a/java/tests/instrumentation/src/com/google/android/icing/IcingSearchEngineTest.java b/java/tests/instrumentation/src/com/google/android/icing/IcingSearchEngineTest.java
index 2019033..0cee80c 100644
--- a/java/tests/instrumentation/src/com/google/android/icing/IcingSearchEngineTest.java
+++ b/java/tests/instrumentation/src/com/google/android/icing/IcingSearchEngineTest.java
@@ -496,12 +496,13 @@ public final class IcingSearchEngineTest {
assertStatusOk(
icingSearchEngine.setSchema(schema, /*ignoreErrorsAndDeleteDocuments=*/ false).getStatus());
- // String: "我每天走路去上班。"
- // ^ ^ ^ ^^
- // UTF16 idx: 0 1 3 5 6
- // Breaks into segments: "我", "每天", "走路", "去", "上班"
- String chinese = "我每天走路去上班。";
- assertThat(chinese.length()).isEqualTo(9);
+ // String: "天是蓝的"
+ // ^ ^^ ^
+ // UTF16 idx: 0 1 2 3
+ // Breaks into segments: "天", "是", "蓝", "的"
+ // "The sky is blue"
+ String chinese = "天是蓝的";
+ assertThat(chinese.length()).isEqualTo(4);
DocumentProto emailDocument1 =
createEmailDocument("namespace", "uri1").toBuilder()
.addProperties(PropertyProto.newBuilder().setName("subject").addStringValues(chinese))
@@ -511,7 +512,7 @@ public final class IcingSearchEngineTest {
// Search and request snippet matching but no windowing.
SearchSpecProto searchSpec =
SearchSpecProto.newBuilder()
- .setQuery("每")
+ .setQuery("是")
.setTermMatchType(TermMatchType.Code.PREFIX)
.build();
ResultSpecProto resultSpecProto =
@@ -550,9 +551,9 @@ public final class IcingSearchEngineTest {
int matchStart = matchProto.getExactMatchUtf16Position();
int matchEnd = matchStart + matchProto.getExactMatchUtf16Length();
assertThat(matchStart).isEqualTo(1);
- assertThat(matchEnd).isEqualTo(3);
+ assertThat(matchEnd).isEqualTo(2);
String match = content.substring(matchStart, matchEnd);
- assertThat(match).isEqualTo("每天");
+ assertThat(match).isEqualTo("是");
}
@Test