Skip to content

Commit

Permalink
Adjust contract for assertTimeoutPreemptively
Browse files Browse the repository at this point in the history
Invocation kind for the executable is UNKNOWN for
assertTimeoutPreemptively methods

Issue: junit-team#1866
  • Loading branch information
awelless committed Sep 1, 2023
1 parent 9920cf9 commit 4d21486
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -517,7 +517,7 @@ fun <R> assertTimeout(timeout: Duration, message: () -> String, executable: () -
@API(status = EXPERIMENTAL, since = "5.5")
fun <R> assertTimeoutPreemptively(timeout: Duration, executable: () -> R): R {
contract {
callsInPlace(executable, EXACTLY_ONCE)
callsInPlace(executable, UNKNOWN)
}

return Assertions.assertTimeoutPreemptively(timeout, executable)
Expand All @@ -536,7 +536,7 @@ fun <R> assertTimeoutPreemptively(timeout: Duration, executable: () -> R): R {
@API(status = EXPERIMENTAL, since = "5.5")
fun <R> assertTimeoutPreemptively(timeout: Duration, message: String, executable: () -> R): R {
contract {
callsInPlace(executable, EXACTLY_ONCE)
callsInPlace(executable, UNKNOWN)
}

return Assertions.assertTimeoutPreemptively(timeout, executable, message)
Expand All @@ -555,7 +555,7 @@ fun <R> assertTimeoutPreemptively(timeout: Duration, message: String, executable
@API(status = EXPERIMENTAL, since = "5.5")
fun <R> assertTimeoutPreemptively(timeout: Duration, message: () -> String, executable: () -> R): R {
contract {
callsInPlace(executable, EXACTLY_ONCE)
callsInPlace(executable, UNKNOWN)
callsInPlace(message, AT_MOST_ONCE)
}

Expand Down

0 comments on commit 4d21486

Please sign in to comment.