From 5a70965434d229d774e83b4346df2c293fa996c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alaksiej=20=C5=A0=C4=8Darbaty?= Date: Fri, 1 Sep 2023 21:47:58 +0200 Subject: [PATCH] Rename variable names in new assertion examples Issue: #1866 --- .../org/junit/jupiter/api/Assertions.kt | 78 +++++++++---------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/junit-jupiter-api/src/main/kotlin/org/junit/jupiter/api/Assertions.kt b/junit-jupiter-api/src/main/kotlin/org/junit/jupiter/api/Assertions.kt index bd901c1e7a13..6105579258f6 100644 --- a/junit-jupiter-api/src/main/kotlin/org/junit/jupiter/api/Assertions.kt +++ b/junit-jupiter-api/src/main/kotlin/org/junit/jupiter/api/Assertions.kt @@ -105,12 +105,12 @@ fun assertAll(heading: String?, vararg executables: () -> Unit) = /** * Example usage: * ```kotlin - * val string: String? = ... + * val nullableString: String? = ... * - * assertNull(string) + * assertNull(nullableString) * - * // compiler won't allow even safe calls, since the string is always null - * // string?.isNotEmpty() + * // compiler won't allow even safe calls, since the nullableString is always null + * // nullableString?.isNotEmpty() * ``` * @see Assertions.assertNull */ @@ -126,12 +126,12 @@ fun assertNull(actual: Any?) { /** * Example usage: * ```kotlin - * val string: String? = ... + * val nullableString: String? = ... * - * assertNull(string, "Should be nullable") + * assertNull(nullableString, "Should be nullable") * - * // compiler won't allow even safe calls, since the string is always null - * // string?.isNotEmpty() + * // compiler won't allow even safe calls, since the nullableString is always null + * // nullableString?.isNotEmpty() * ``` * @see Assertions.assertNull */ @@ -147,12 +147,12 @@ fun assertNull(actual: Any?, message: String) { /** * Example usage: * ```kotlin - * val string: String? = ... + * val nullableString: String? = ... * - * assertNull(string) { "Should be nullable" } + * assertNull(nullableString) { "Should be nullable" } * - * // compiler won't allow even safe calls, since the string is always null - * // string?.isNotEmpty() + * // compiler won't allow even safe calls, since the nullableString is always null + * // nullableString?.isNotEmpty() * ``` * @see Assertions.assertNull */ @@ -170,12 +170,12 @@ fun assertNull(actual: Any?, messageSupplier: () -> String) { /** * Example usage: * ```kotlin - * val string: String? = ... + * val nullableString: String? = ... * - * assertNotNull(string) + * assertNotNull(nullableString) * * // compiler smart casts nullableString to a non-nullable object - * assertTrue(string.isNotEmpty()) + * assertTrue(nullableString.isNotEmpty()) * ``` * @see Assertions.assertNotNull */ @@ -191,12 +191,12 @@ fun assertNotNull(actual: Any?) { /** * Example usage: * ```kotlin - * val string: String? = ... + * val nullableString: String? = ... * - * assertNotNull(string, "Should be non-nullable") + * assertNotNull(nullableString, "Should be non-nullable") * * // compiler smart casts nullableString to a non-nullable object - * assertTrue(string.isNotEmpty()) + * assertTrue(nullableString.isNotEmpty()) * ``` * @see Assertions.assertNotNull */ @@ -212,12 +212,12 @@ fun assertNotNull(actual: Any?, message: String) { /** * Example usage: * ```kotlin - * val string: String? = ... + * val nullableString: String? = ... * - * assertNotNull(string) { "Should be non-nullable" } + * assertNotNull(nullableString) { "Should be non-nullable" } * * // compiler smart casts nullableString to a non-nullable object - * assertTrue(string.isNotEmpty()) + * assertTrue(nullableString.isNotEmpty()) * ``` * @see Assertions.assertNotNull */ @@ -235,12 +235,12 @@ fun assertNotNull(actual: Any?, messageSupplier: () -> String) { /** * Example usage: * ```kotlin - * val string: Any = ... + * val maybeString: Any = ... * - * assertInstanceOf(string) + * assertInstanceOf(maybeString) * - * // compiler smart casts string to a String object - * assertTrue(string.isNotEmpty()) + * // compiler smart casts maybeString to a String object + * assertTrue(maybeString.isNotEmpty()) * ``` * @see Assertions.assertInstanceOf */ @@ -256,12 +256,12 @@ inline fun assertInstanceOf(actual: Any?) { /** * Example usage: * ```kotlin - * val string: Any = ... + * val maybeString: Any = ... * - * assertInstanceOf(string, "Should be a String") + * assertInstanceOf(maybeString, "Should be a String") * - * // compiler smart casts string to a String object - * assertTrue(string.isNotEmpty()) + * // compiler smart casts maybeString to a String object + * assertTrue(maybeString.isNotEmpty()) * ``` * @see Assertions.assertInstanceOf */ @@ -277,12 +277,12 @@ inline fun assertInstanceOf(actual: Any?, message: String) { /** * Example usage: * ```kotlin - * val string: Any = ... + * val maybeString: Any = ... * - * assertInstanceOf(string) { "Should be a String" } + * assertInstanceOf(maybeString) { "Should be a String" } * - * // compiler smart casts string to a String object - * assertTrue(string.isNotEmpty()) + * // compiler smart casts maybeString to a String object + * assertTrue(maybeString.isNotEmpty()) * ``` * @see Assertions.assertInstanceOf */ @@ -453,7 +453,7 @@ internal inline fun evaluateAndWrap(executable: () -> R): ThrowingSupplier assertTimeout(timeout: Duration, executable: () -> R): R { @@ -472,7 +472,7 @@ fun assertTimeout(timeout: Duration, executable: () -> R): R { * } * ``` * @see Assertions.assertTimeout - * @paramR the result of the [executable]. + * @param R the result of the [executable]. */ @API(status = EXPERIMENTAL, since = "5.5") fun assertTimeout(timeout: Duration, message: String, executable: () -> R): R { @@ -491,7 +491,7 @@ fun assertTimeout(timeout: Duration, message: String, executable: () -> R): * } * ``` * @see Assertions.assertTimeout - * @paramR the result of the [executable]. + * @param R the result of the [executable]. */ @API(status = EXPERIMENTAL, since = "5.5") fun assertTimeout(timeout: Duration, message: () -> String, executable: () -> R): R { @@ -511,7 +511,7 @@ fun assertTimeout(timeout: Duration, message: () -> String, executable: () - * } * ``` * @see Assertions.assertTimeoutPreemptively - * @paramR the result of the [executable]. + * @param R the result of the [executable]. */ @API(status = EXPERIMENTAL, since = "5.5") fun assertTimeoutPreemptively(timeout: Duration, executable: () -> R): R { @@ -530,7 +530,7 @@ fun assertTimeoutPreemptively(timeout: Duration, executable: () -> R): R { * } * ``` * @see Assertions.assertTimeoutPreemptively - * @paramR the result of the [executable]. + * @param R the result of the [executable]. */ @API(status = EXPERIMENTAL, since = "5.5") fun assertTimeoutPreemptively(timeout: Duration, message: String, executable: () -> R): R { @@ -549,7 +549,7 @@ fun assertTimeoutPreemptively(timeout: Duration, message: String, executable * } * ``` * @see Assertions.assertTimeoutPreemptively - * @paramR the result of the [executable]. + * @param R the result of the [executable]. */ @API(status = EXPERIMENTAL, since = "5.5") fun assertTimeoutPreemptively(timeout: Duration, message: () -> String, executable: () -> R): R {