-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Introduced update section for Kotlin 2.0
- Loading branch information
Showing
1 changed file
with
12 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. | ||
|
@@ -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 --> | ||
|
@@ -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 | ||
|