Skip to content

Commit 80806f0

Browse files
authored
Merge pull request #173 from SimY4/update/kotest-property-jvm-6.0.0
Update kotest-property-jvm to 6.0.0
2 parents 50e1181 + 16bd1da commit 80806f0

File tree

5 files changed

+15
-17
lines changed

5 files changed

+15
-17
lines changed

build.sbt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,12 @@ lazy val kotest = (project in file("kotest"))
133133
description := "Kotest bindings for coregex library.",
134134
headerEndYear := Some(2025),
135135
libraryDependencies ++= Seq(
136-
"io.kotest" % "kotest-property-jvm" % "5.9.1" % Provided,
136+
"io.kotest" % "kotest-property-jvm" % "6.0.0" % Provided,
137137
"com.github.sbt.junit" % "jupiter-interface" % JupiterKeys.jupiterVersion.value % Test
138138
),
139139
testOptions += Tests.Argument(jupiterTestFramework, "-q", "-v")
140140
)
141-
.settings(javaLibSettings(8))
141+
.settings(javaLibSettings(11))
142142
.settings(jacocoSettings)
143143
.dependsOn(core)
144144

kotest/src/main/java/com/github/simy4/coregex/kotest/CoregexArbitrary.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,15 @@ public Classifier<? extends java.lang.String> getClassifier() {
5555

5656
@Nullable
5757
@Override
58-
public String edgecase(@NotNull RandomSource randomSource) {
58+
public Sample<String> edgecase(@NotNull RandomSource randomSource) {
5959
return null;
6060
}
6161

6262
@NotNull
6363
@Override
6464
public Sample<String> sample(@NotNull RandomSource randomSource) {
65-
long seed = randomSource.getRandom().nextLong();
66-
String sample = coregex.generate(seed);
65+
var seed = randomSource.getRandom().nextLong();
66+
var sample = coregex.generate(seed);
6767
return new Sample<>(
6868
sample, new RTree<>(() -> sample, lazy(new CoregexShrinker(coregex, seed))));
6969
}
@@ -84,7 +84,7 @@ public List<RTree<String>> invoke() {
8484
.shrink()
8585
.map(
8686
coregex -> {
87-
String shrink = coregex.generate(seed);
87+
var shrink = coregex.generate(seed);
8888
return Collections.singletonList(
8989
new RTree<>(() -> shrink, lazy(new CoregexShrinker(coregex, seed))));
9090
})

kotest/src/test/java/com/github/simy4/coregex/kotest/CoregexArbitraryTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@ void shouldGenerateMatchingIPv4String() throws InterruptedException {
5151
CoregexArbitrary.of(
5252
"((25[0-5]|(2[0-4]|1?[0-9])?[0-9])\\.){3}(25[0-5]|(2[0-4]|1?[0-9])?[0-9])"),
5353
(___, ipv4, c2) -> {
54-
String[] expected = ipv4.split("\\.");
55-
String[] actual =
54+
var expected = ipv4.split("\\.");
55+
var actual =
5656
assertDoesNotThrow(() -> InetAddress.getByName(ipv4))
5757
.getHostAddress()
5858
.split("\\.");
@@ -69,7 +69,7 @@ void shouldGenerateMatchingIPv4String() throws InterruptedException {
6969

7070
@Test
7171
void shouldGenerateMatchingIsoDateString() throws InterruptedException {
72-
DateTimeFormatter formatter = DateTimeFormatter.ISO_INSTANT;
72+
var formatter = DateTimeFormatter.ISO_INSTANT;
7373
runBlocking(
7474
EmptyCoroutineContext.INSTANCE,
7575
(__, c1) ->

kotest/src/test/java/com/github/simy4/coregex/kotest/KotestTest.java

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,9 @@
2222

2323
import io.kotest.property.Arb;
2424
import io.kotest.property.RTree;
25-
import io.kotest.property.Sample;
2625
import io.kotest.property.arbitrary.CollectionsKt;
2726
import java.util.ArrayDeque;
2827
import java.util.Collections;
29-
import java.util.Queue;
3028
import java.util.regex.Pattern;
3129
import kotlin.Unit;
3230
import kotlin.coroutines.EmptyCoroutineContext;
@@ -42,13 +40,13 @@ void shrinkingTest() throws InterruptedException {
4240
checkAll(
4341
regexes(),
4442
(context, regex, c2) -> {
45-
Arb<String> coregexArbitrary = new CoregexArbitrary(regex);
46-
Sample<String> sample = coregexArbitrary.sample(context.randomSource());
47-
Queue<RTree<String>> shrinks = Collections.asLifoQueue(new ArrayDeque<>());
43+
var coregexArbitrary = new CoregexArbitrary(regex);
44+
var sample = coregexArbitrary.sample(context.randomSource());
45+
var shrinks = Collections.asLifoQueue(new ArrayDeque<RTree<String>>());
4846
shrinks.add(sample.getShrinks());
4947
while (!shrinks.isEmpty()) {
50-
RTree<String> shrink = shrinks.remove();
51-
String shrinkValue = shrink.getValue().invoke();
48+
var shrink = shrinks.remove();
49+
var shrinkValue = shrink.getValue().invoke();
5250
assertTrue(regex.matcher(shrinkValue).matches());
5351
shrinks.addAll(shrink.getChildren().getValue());
5452
}

version.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
ThisBuild / version := "1.2.1-SNAPSHOT"
1+
ThisBuild / version := "1.3.0-SNAPSHOT"

0 commit comments

Comments
 (0)