Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ private static void assertScan(RexNode predicate, List<Long> expectedIds, long e

// Then
assertThat(filters).as("captured in full, so Calcite does not re-check").isEmpty();
assertThat(result).containsExactlyElementsOf(expectedIds);
assertThat(result).isEqualTo(expectedIds);
assertThat(table.chunksScannedLastQuery()).as("chunks decoded").isEqualTo(expectedChunks);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ void rewrite_keepsMultiByteTextAndNulls(@TempDir Path tmp) throws IOException {

// Then
assertThat(result.status()).as(result.stderr()).isEqualTo(ExitStatus.OK);
assertThat(strings(output, NAME)).containsExactly(values);
assertThat(strings(output, NAME)).isEqualTo(java.util.Arrays.asList(values));
}

@ParameterizedTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ void fromLongsArray_invertsToLongs(PType ptype) {
Object result = PrimitiveArrays.fromLongsArray(wide, ptype, EncodingId.VORTEX_PRIMITIVE);

// Then
assertThat(PrimitiveArrays.toLongs(result, ptype, EncodingId.VORTEX_PRIMITIVE)).containsExactly(wide);
assertThat(PrimitiveArrays.toLongs(result, ptype, EncodingId.VORTEX_PRIMITIVE)).isEqualTo(wide);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void roundTripsBytes() throws IOException {
byte[] result = readerOver(w.toByteArray()).readBytes();

// Then
assertThat(result).containsExactly(payload);
assertThat(result).isEqualTo(payload);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ void narrowArrayInto_eightByteTypes_copy_andFloatCarriersAreRebuiltFromRawBits()
sut.narrowArrayInto(VALUES, PType.F64, doubles);

// Then the 8-byte types are unchanged and each float carrier holds the low bits of the value
assertThat(copied).containsExactly(VALUES);
assertThat(copied).isEqualTo(VALUES);
for (int i = 0; i < VALUES.length; i++) {
assertThat(halves[i]).isEqualTo((short) VALUES[i]);
assertThat(Float.floatToRawIntBits(floats[i])).isEqualTo((int) VALUES[i]);
Expand Down Expand Up @@ -542,7 +542,7 @@ void widenInto_floats_readLikeTheUnsignedTypeOfTheSameWidth(PType ptype) {
sut.widenInto(src, 0, VALUES.length, ptype, result);

// Then
assertThat(result).containsExactly(expected);
assertThat(result).isEqualTo(expected);
}
}

Expand Down Expand Up @@ -914,7 +914,7 @@ void widenArrayInto_matchesReference(PType ptype) {
sut.widenArrayInto(values, from, length, ptype, result);

// Then, including the untouched slot past count
assertThat(result).as("%s length=%d from=%d", ptype, length, from).containsExactly(expected);
assertThat(result).as("%s length=%d from=%d", ptype, length, from).isEqualTo(expected);
}
}
}
Expand All @@ -936,7 +936,7 @@ void widenInto_matchesReference(PType ptype) {
sut.widenInto(segment, from, length, ptype, result);

// Then
assertThat(result).as("%s length=%d from=%d", ptype, length, from).containsExactly(expected);
assertThat(result).as("%s length=%d from=%d", ptype, length, from).isEqualTo(expected);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ void build_sumsSegmentBytesAndCountsSegments() {
// Then
assertThat(sut.segmentCount()).isEqualTo(3);
assertThat(sut.totalSegmentBytes()).isEqualTo(128L + 256L + 64L);
assertThat(sut.segmentSpecs()).containsExactlyElementsOf(segs);
assertThat(sut.segmentSpecs()).isEqualTo(segs);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void highPrecisionF64_selectsAlpRd_andRoundTrips(@TempDir Path tmp) throws IOExc
}
}
}
assertThat(got).containsExactly(data);
assertThat(got).isEqualTo(data);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void jniWriter_translatedFilters_returnExactlyTheMatchingRows(String where, Stri
}

// Then
assertThat(result).containsExactlyElementsOf(
assertThat(result).isEqualTo(
java.util.Arrays.stream(expected.split(",")).map(String::trim).map(Long::valueOf).toList());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void fullScan_decodesEveryVectorAndNull(@TempDir Path tmp) throws IOException {
SequencedMap<Long, float[]> result = readVectors(file, ScanOptions.all());

// Then
assertThat(result.keySet()).containsExactlyElementsOf(ids(0, ROWS));
assertThat(List.copyOf(result.keySet())).isEqualTo(ids(0, ROWS));
assertEachVectorMatchesItsId(result);
// the null rows, listed by id rather than compared with vector(): a fixture that stops
// writing nulls still agrees with vector() and passes the check above, so only this
Expand Down Expand Up @@ -164,7 +164,7 @@ void limitedScan_returnsTheFirstRows(@TempDir Path tmp) throws IOException {
SequencedMap<Long, float[]> result = readVectors(file, ScanOptions.all().withLimit(ScanLimit.of(limit)));

// Then
assertThat(result.keySet()).containsExactlyElementsOf(ids(0, limit));
assertThat(List.copyOf(result.keySet())).isEqualTo(ids(0, limit));
assertEachVectorMatchesItsId(result);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,10 @@ void jniWriter_javaReader_fullAndFiltered(Element element, int size, @TempDir Pa
assertThat(full).hasSize(ROWS);
full.forEach(row -> assertThat((List<?>) row[1]).isEqualTo(list(element, size, (Long) row[0])));
assertThat(full.stream().map(row -> (Long) row[0]).toList())
.containsExactlyElementsOf(java.util.stream.LongStream.range(0, ROWS).boxed().toList());
.isEqualTo(java.util.stream.LongStream.range(0, ROWS).boxed().toList());
// pruning may keep rows below the threshold, but must keep every row at or above it
assertThat(filtered.stream().map(row -> (Long) row[0]).filter(id -> id >= THRESHOLD).toList())
.containsExactlyElementsOf(java.util.stream.LongStream.range(THRESHOLD, ROWS).boxed().toList());
.isEqualTo(java.util.stream.LongStream.range(THRESHOLD, ROWS).boxed().toList());
filtered.forEach(row -> assertThat((List<?>) row[1]).isEqualTo(list(element, size, (Long) row[0])));
}

Expand Down Expand Up @@ -460,7 +460,7 @@ private static void assertJavaRows(List<Object[]> rows, Element element, int siz
private static void assertJavaRows(List<Object[]> rows, Element element, int size, Nulls nulls,
ElementNulls elementNulls, int total) {
assertThat(rows.stream().map(row -> (Long) row[0]).toList())
.containsExactlyElementsOf(java.util.stream.LongStream.range(0, total).boxed().toList());
.isEqualTo(java.util.stream.LongStream.range(0, total).boxed().toList());
rows.forEach(row -> assertThat(row[1]).as("row %s", row[0])
.isEqualTo(nulls.isNull((Long) row[0]) ? null : list(element, size, (Long) row[0], elementNulls)));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void jniWriter_javaReader_everyRow(Element element, int outerSize, int innerSize
List<List<List<Object>>> result = readJava(file, element, outerSize, innerSize);

// Then
assertThat(result).containsExactlyElementsOf(model);
assertThat(result).isEqualTo(model);
}

/// Every row as the reader should see it: null, or `outerSize` inner lists, each null or
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ void jniWriter_javaReader_everyRow(Element element, int size, Nulls outer, Nulls
List<List<List<Object>>> result = readJava(file, element, size);

// Then
assertThat(result).containsExactlyElementsOf(model);
assertThat(result).isEqualTo(model);
}

/// Every row of the column as the reader should see it: null, or `size` inner lists, each null
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ void javaWriter_jniReader_keepsEveryHalfBit(String label, WriteOptions options,
short[] result = readWithJni(file);

// Then
assertThat(result).as(label).containsExactly(data);
assertThat(result).as(label).isEqualTo(data);
if (expectedEncoding != null) {
try (VortexReader reader = VortexReader.open(file, ReadRegistry.loadAll())) {
assertThat(VortexInspector.inspect(reader)).as("%s: the file must hold the forced encoding", label)
Expand All @@ -165,7 +165,7 @@ void jniWriter_javaReader_keepsEveryHalfBit(String shape, short[] data, @TempDir
short[] result = readWithJava(file);

// Then
assertThat(result).as(shape).containsExactly(data);
assertThat(result).as(shape).isEqualTo(data);
}

@ParameterizedTest
Expand All @@ -182,7 +182,7 @@ void jniWriter_javaReader_constantColumnOfAnyLength(int rows, @TempDir Path tmp)
short[] result = readWithJava(file);

// Then
assertThat(result).containsExactly(data);
assertThat(result).isEqualTo(data);
}

/// Every 7th row null, written in three chunks: Rust must read the validity and the values.
Expand Down Expand Up @@ -298,7 +298,7 @@ private static void assertValuesAndValidity(String label, Object[] read, short[]
short[] values = (short[]) read[0];
boolean[] isValid = (boolean[]) read[1];
assertThat(values).as(label).hasSameSizeAs(data);
assertThat(isValid).as(label + " validity").containsExactly(valid);
assertThat(isValid).as(label + " validity").isEqualTo(valid);
for (int i = 0; i < data.length; i++) {
if (valid[i]) {
assertThat(values[i]).as("%s row %d", label, i).isEqualTo(data[i]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,8 @@ void javaWriter_bothReaders_keepEveryNull(EncodingId encoding, Element element,
List<Object> byJava = readJava(file, element);

// Then
assertThat(byRust).as("read by vortex-jni").containsExactlyElementsOf(expected);
assertThat(byJava).as("read by vortex-java").containsExactlyElementsOf(expected);
assertThat(byRust).as("read by vortex-jni").isEqualTo(expected);
assertThat(byJava).as("read by vortex-java").isEqualTo(expected);
try (VortexReader reader = VortexReader.open(file, ReadRegistry.loadAll())) {
if (VortexInspector.inspect(reader).contains(encoding.toString())) {
WRITTEN.add(encoding.toString());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void patched_i32_javaWriteJavaRead(@TempDir Path tmp) throws IOException {

// Then — the Java reader reconstructs base values + patched outliers exactly
int[] decoded = readIntColumn(file, "v");
assertThat(decoded).containsExactly(data);
assertThat(decoded).isEqualTo(data);
}

/// `fastlanes.delta` decode across every width it accepts, over three FastLanes chunks.
Expand Down Expand Up @@ -125,7 +125,7 @@ void delta_javaWriteJavaRead(PType ptype, @TempDir Path tmp) throws IOException
assertThat(InspectorTree.build(reader).usedEncodings()).contains("fastlanes.delta");
}
// compared as stored bit patterns, so signed and unsigned widths assert alike
assertThat(readColumnBits(file, "v", mask)).containsExactly(expected);
assertThat(readColumnBits(file, "v", mask)).isEqualTo(expected);
}

/// `fastlanes.delta`'s `offset` metadata — which makes a decode start partway into the
Expand Down
Loading
Loading