Skip to content

Commit beadab8

Browse files
dfa1claude
andcommitted
test: harden jqwik property tests — larger ranges, full Long range, unicode
- i64: switch to Arbitraries.longs() (full Long range incl. MIN/MAX/negatives), 0–10_000 elements, drop List<Long> wrapper, bump tries to 30 - ascii strings: 0–5_000 elements, strings up to 100 chars (was 200/20) - u16 dict: 257–5_000 unique strings (was 300), strings up to 20 chars - unicode: 0–1_000 elements, strings up to 50 chars (was 100/10) - Remove leftover System.out.println and unused @SiZe import Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 4369813 commit beadab8

1 file changed

Lines changed: 20 additions & 16 deletions

File tree

integration/src/test/java/io/github/dfa1/vortex/integration/JavaWritesRustReadsIntegrationTest.java

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
import net.jqwik.api.ForAll;
2626
import net.jqwik.api.Property;
2727
import net.jqwik.api.Provide;
28-
import net.jqwik.api.constraints.Size;
2928
import org.junit.jupiter.api.Test;
3029
import org.junit.jupiter.api.io.TempDir;
3130

@@ -418,13 +417,11 @@ void prop_dictUtf8_unicode_roundTripsViaRust(
418417
}
419418
}
420419

421-
/// I64 column: arbitrary longs survive Java write → Rust JNI read.
422-
@Property(tries = 20)
423-
void prop_i64_roundTripsViaRust(
424-
@ForAll @Size(min = 1, max = 500) List<Long> values) throws IOException {
420+
/// I64 column: full Long range (MIN_VALUE, MAX_VALUE, negatives), empty and large arrays.
421+
@Property(tries = 30)
422+
void prop_i64_roundTripsViaRust(@ForAll("i64Arrays") long[] data) throws IOException {
425423
Path tmp = Files.createTempDirectory("vortex-pbt-i64");
426424
try {
427-
long[] data = values.stream().mapToLong(Long::longValue).toArray();
428425
Path file = tmp.resolve("pbt_i64.vtx");
429426
try (var ch = FileChannel.open(file, StandardOpenOption.CREATE, StandardOpenOption.WRITE);
430427
var sut = VortexWriter.create(ch, TS_SCHEMA, WriteOptions.defaults())) {
@@ -441,30 +438,37 @@ void prop_i64_roundTripsViaRust(
441438
Arbitrary<String[]> asciiStringArrays() {
442439
Arbitrary<String> strings = Arbitraries.strings()
443440
.alpha()
444-
.ofMinLength(0).ofMaxLength(20);
445-
return strings.array(String[].class).ofMinSize(1).ofMaxSize(200);
441+
.ofMinLength(0).ofMaxLength(100);
442+
return strings.array(String[].class).ofMinSize(0).ofMaxSize(5_000);
446443
}
447444

448445
@Provide
449446
Arbitrary<String[]> u16DictStringArrays() {
450-
// 257 unique strings guaranteed by @UniqueElements on a list, then a suffix of repeats
447+
// 257–5000 unique strings → U16 codes territory
451448
Arbitrary<String> strings = Arbitraries.strings()
452449
.alpha()
453-
.ofMinLength(3).ofMaxLength(12);
454-
return strings.list().ofMinSize(257).ofMaxSize(300)
455-
.map(list -> list.stream().distinct().limit(300).toArray(String[]::new))
450+
.ofMinLength(3).ofMaxLength(20);
451+
return strings.list().ofMinSize(257).ofMaxSize(5_000)
452+
.map(list -> list.stream().distinct().toArray(String[]::new))
456453
.filter(arr -> arr.length >= 257);
457454
}
458455

459456
@Provide
460457
Arbitrary<String[]> unicodeStringArrays() {
461458
Arbitrary<String> strings = Arbitraries.strings()
462-
.withCharRange('€', '퟿')
463-
.ofMinLength(1).ofMaxLength(10);
464-
return strings.array(String[].class).ofMinSize(1).ofMaxSize(100);
459+
.withCharRange('\u4E00', '\uD7FF')
460+
.ofMinLength(0).ofMaxLength(50);
461+
return strings.array(String[].class).ofMinSize(0).ofMaxSize(1_000);
462+
}
463+
464+
@Provide
465+
Arbitrary<long[]> i64Arrays() {
466+
return Arbitraries.longs()
467+
.array(long[].class)
468+
.ofMinSize(0).ofMaxSize(10_000);
465469
}
466470

467-
private static void deleteDir(Path dir) throws IOException {
471+
private static void deleteDir(Path dir) throws IOException {
468472
try (var walk = Files.walk(dir)) {
469473
walk.sorted(Comparator.reverseOrder()).forEach(p -> p.toFile().delete());
470474
}

0 commit comments

Comments
 (0)