Skip to content

Commit

Permalink
test: Speedup property testing
Browse files Browse the repository at this point in the history
  • Loading branch information
hkupty committed Jan 14, 2024
1 parent 607bf5f commit f1cfedb
Showing 1 changed file with 15 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,22 @@ class LoggerStorageTests {

@Provide
Arbitrary<List<String>> loggerNames() {
return
Arbitraries
.strings()
.alpha()
.ofMinLength(2)
.ofMaxLength(5)
.flatMap(prefix ->
Arbitraries
.strings()
.alpha()
.ofMinLength(3)
.ofMaxLength(10)
.list()
.ofMinSize(2)
.ofMaxSize(4)
.map(components -> {
var builder = new StringBuilder(prefix);
components.forEach(item -> builder.append(".").append(item));

return builder.toString();
}))
.list();
var builder = new StringBuilder();
var string = Arbitraries
.strings()
.alpha()
.ofMinLength(3)
.ofMaxLength(32)
.list()
.ofMinSize(2)
.ofMaxSize(6)
.map(components -> {
builder.delete(0, builder.length());
components.forEach(item -> builder.append(".").append(item));
return builder.toString();
});

return string.list();
}

@Property
Expand Down

0 comments on commit f1cfedb

Please sign in to comment.