Skip to content

Commit 7baebc3

Browse files
committed
comments
1 parent b243f1c commit 7baebc3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

firebase-firestore/src/test/java/com/google/firebase/firestore/index/FirestoreIndexValueWriterTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,15 +69,17 @@ public void writeIndexValueSupportsVector() throws ExecutionException, Interrupt
6969
}
7070

7171
@Test
72-
public void writeIndexValueSupportsEmptyVector() throws ExecutionException, InterruptedException {
72+
public void writeIndexValueSupportsEmptyVector() {
7373
UserDataReader dataReader = new UserDataReader(DatabaseId.EMPTY);
7474
Value value = dataReader.parseQueryValue(FieldValue.vector(new double[] {}));
7575

76+
// Encode an actual VectorValue
7677
IndexByteEncoder encoder = new IndexByteEncoder();
7778
FirestoreIndexValueWriter.INSTANCE.writeIndexValue(
7879
value, encoder.forKind(FieldIndex.Segment.Kind.ASCENDING));
7980
byte[] actualBytes = encoder.getEncodedBytes();
8081

82+
// Create the expected representation of the encoded vector
8183
IndexByteEncoder expectedEncoder = new IndexByteEncoder();
8284
DirectionalIndexByteEncoder expectedDirectionalEncoder =
8385
expectedEncoder.forKind(FieldIndex.Segment.Kind.ASCENDING);
@@ -95,6 +97,7 @@ public void writeIndexValueSupportsEmptyVector() throws ExecutionException, Inte
9597
expectedDirectionalEncoder.writeInfinity();
9698
byte[] expectedBytes = expectedEncoder.getEncodedBytes();
9799

100+
// Assert actual and expected encodings are equal
98101
Assert.assertArrayEquals(actualBytes, expectedBytes);
99102
}
100103
}

0 commit comments

Comments
 (0)