Skip to content
This repository was archived by the owner on Mar 10, 2022. It is now read-only.

Commit 2019426

Browse files
author
hideki
committed
update test
1 parent 2cd0ba3 commit 2019426

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/androidTest/java/com/couchbase/lite/ViewsTest.java

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3232,7 +3232,7 @@ public void map(Map<String, Object> document, Emitter emitter) {
32323232
assertEquals(0, rows.getCount());
32333233
}
32343234

3235-
//
3235+
// - (void) test28_Nil_Key
32363236
public void testEmitWithNullKey() throws Exception {
32373237
// set up view
32383238
View view = database.getView("vu");
@@ -3241,7 +3241,8 @@ public void testEmitWithNullKey() throws Exception {
32413241
@Override
32423242
public void map(Map<String, Object> document, Emitter emitter) {
32433243
// null key -> ignored
3244-
emitter.emit(null, null);
3244+
emitter.emit(null, "foo");
3245+
emitter.emit("name", "bar");
32453246
}
32463247
}, "1");
32473248
assertNotNull(view.getMap());
@@ -3257,7 +3258,11 @@ public void map(Map<String, Object> document, Emitter emitter) {
32573258
assertNotNull(query);
32583259
QueryEnumerator e = query.run();
32593260
assertNotNull(e);
3260-
assertEquals(0, e.getCount());
3261+
assertEquals(1, e.getCount());
3262+
QueryRow row = e.getRow(0);
3263+
assertNotNull(row);
3264+
assertEquals("name", row.getKey());
3265+
assertEquals("bar", row.getValue());
32613266

32623267
// query with null key. it should be ignored. this caused exception previously for sqlite
32633268
query.setKeys(Collections.singletonList(null));

0 commit comments

Comments
 (0)