Tests for the shipped data layer, New options and concurrent Fake

This commit is contained in:
2026-09-01 23:03:53 +02:00
parent cf9de21495
commit 91cbae2a44
10 changed files with 201 additions and 55 deletions
+2 -3
View File
@@ -8,7 +8,7 @@ import (
func benchGenerator(b *testing.B, dir string) *Generator {
b.Helper()
f, err := New([]string{dir}, WithSeed(1))
f, err := New(WithoutShippedData(), WithDataPath(dir), WithSeed(1))
if err != nil {
b.Fatal(err)
}
@@ -91,11 +91,10 @@ func BenchmarkBoundWide(b *testing.B) {
benchPath(b, dir, "row")
}
// BenchmarkNew measures load+compile+validate of the whole shipped tree.
func BenchmarkNew(b *testing.B) {
b.ReportAllocs()
for i := 0; i < b.N; i++ {
if _, err := New([]string{"data"}, WithSeed(1)); err != nil {
if _, err := New(WithSeed(1)); err != nil {
b.Fatal(err)
}
}