Skip to content

Commit

Permalink
Introduced update section for Kotlin 2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
jlink committed Aug 2, 2024
1 parent 5cd81c9 commit e658c26
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Property-based Testing in Kotlin

#### Last Update: July 30, 2024
#### Last Update: August 2, 2024

Kotlin is currently the most hyped language on the JVM. With good reason.
Most parts of Kotlin are fully compatible with Java.
Expand All @@ -18,12 +18,19 @@ __This article__ wants to fill the gap a little bit.
It covers the application of PBT in Kotlin using
[jqwik](https://jqwik.net) and [jqwik's Kotlin module](https://jqwik.net/docs/current/user-guide.html#kotlin-module).

#### Update
#### Update 1

In May 2022 I was a guest on JetBrains' Kotlin YouTube channel talking about the PBT with Kotlin.
You may want to [watch the recording](https://www.youtube.com/watch?v=dPhZIo27fYE)
hopefully being motivated by it to read on.

#### Update 2

As of jqwik version `1.9.0` the kotlin module supports Kotlin 2.0 - including the new K2 compiler.
Among other things, this requires a different parameter to handle nullability annotations correctly.
See [configuration](#setting-up-jqwik-for-kotlin) for details.


<!-- Generated toc must be stripped of `nbsp` occurrences in links -->
<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
Expand Down Expand Up @@ -185,7 +192,9 @@ Here's how you can do that in a Gradle build file using the Kotlin syntax:
tasks.withType<KotlinCompile> {
kotlinOptions {
freeCompilerArgs = listOf(
"-Xjsr305=strict", // Strict interpretation of nullability annotations in jqwik API
// Strict interpretation of nullability annotations in jqwik API
"-Xjsr305=strict", // For jqwik < 1.9.0
"[email protected]:strict" // For jqwik >= 1.9.0
"-Xemit-jvm-type-annotations" // Enable nnotations on type variables
)
jvmTarget = "17" // 1.8 or above
Expand Down

0 comments on commit e658c26

Please sign in to comment.