Skip to content

Commit

Permalink
Make the comments be sentences
Browse files Browse the repository at this point in the history
  • Loading branch information
awelless committed Sep 1, 2023
1 parent 666f73f commit 9920cf9
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
Expand Up @@ -110,7 +110,7 @@ fun assertAll(heading: String?, vararg executables: () -> Unit) =
*
* assertNull(nullableString)
*
* // compiler won't allow even safe calls, since the nullableString is always null
* // The compiler won't allow even safe calls, since nullableString is always null.
* // nullableString?.isNotEmpty()
* ```
* @see Assertions.assertNull
Expand All @@ -131,7 +131,7 @@ fun assertNull(actual: Any?) {
*
* assertNull(nullableString, "Should be nullable")
*
* // compiler won't allow even safe calls, since the nullableString is always null
* // The compiler won't allow even safe calls, since nullableString is always null.
* // nullableString?.isNotEmpty()
* ```
* @see Assertions.assertNull
Expand All @@ -152,7 +152,7 @@ fun assertNull(actual: Any?, message: String) {
*
* assertNull(nullableString) { "Should be nullable" }
*
* // compiler won't allow even safe calls, since the nullableString is always null
* // The compiler won't allow even safe calls, since nullableString is always null.
* // nullableString?.isNotEmpty()
* ```
* @see Assertions.assertNull
Expand All @@ -175,7 +175,7 @@ fun assertNull(actual: Any?, messageSupplier: () -> String) {
*
* assertNotNull(nullableString)
*
* // compiler smart casts nullableString to a non-nullable object
* // The compiler smart casts nullableString to a non-nullable object.
* assertTrue(nullableString.isNotEmpty())
* ```
* @see Assertions.assertNotNull
Expand All @@ -196,7 +196,7 @@ fun assertNotNull(actual: Any?) {
*
* assertNotNull(nullableString, "Should be non-nullable")
*
* // compiler smart casts nullableString to a non-nullable object
* // The compiler smart casts nullableString to a non-nullable object.
* assertTrue(nullableString.isNotEmpty())
* ```
* @see Assertions.assertNotNull
Expand All @@ -217,7 +217,7 @@ fun assertNotNull(actual: Any?, message: String) {
*
* assertNotNull(nullableString) { "Should be non-nullable" }
*
* // compiler smart casts nullableString to a non-nullable object
* // The compiler smart casts nullableString to a non-nullable object.
* assertTrue(nullableString.isNotEmpty())
* ```
* @see Assertions.assertNotNull
Expand All @@ -240,7 +240,7 @@ fun assertNotNull(actual: Any?, messageSupplier: () -> String) {
*
* assertInstanceOf<String>(maybeString)
*
* // compiler smart casts maybeString to a String object
* // The compiler smart casts maybeString to a String object.
* assertTrue(maybeString.isNotEmpty())
* ```
* @see Assertions.assertInstanceOf
Expand All @@ -261,7 +261,7 @@ inline fun <reified T : Any> assertInstanceOf(actual: Any?) {
*
* assertInstanceOf<String>(maybeString, "Should be a String")
*
* // compiler smart casts maybeString to a String object
* // The compiler smart casts maybeString to a String object.
* assertTrue(maybeString.isNotEmpty())
* ```
* @see Assertions.assertInstanceOf
Expand All @@ -282,7 +282,7 @@ inline fun <reified T : Any> assertInstanceOf(actual: Any?, message: String) {
*
* assertInstanceOf<String>(maybeString) { "Should be a String" }
*
* // compiler smart casts maybeString to a String object
* // The compiler smart casts maybeString to a String object.
* assertTrue(maybeString.isNotEmpty())
* ```
* @see Assertions.assertInstanceOf
Expand Down
Expand Up @@ -216,15 +216,15 @@ class KotlinAssertionsTests {
val nullableString: String? = "string"

assertNotNull(nullableString)
assertFalse(nullableString.isEmpty()) // smart cast to a non nullable object
assertFalse(nullableString.isEmpty()) // A smart cast to a non-nullable object.
}

@Test
fun `assertNull with compiler smart cast`() {
val nullableString: String? = null

assertNull(nullableString)
// even safe call is not allowed, because compiler knows that string is always null
// Even safe call is not allowed because compiler knows that nullableString is always null.
// nullableString?.isEmpty()
}

Expand All @@ -233,15 +233,15 @@ class KotlinAssertionsTests {
val string: Any = "string"

assertInstanceOf<String>(string)
assertFalse(string.isEmpty()) // smart cast to a String object
assertFalse(string.isEmpty()) // A smart cast to a String object.
}

@Test
fun `assertInstanceOf with compiler nullable smart cast`() {
val string: Any? = "string"

assertInstanceOf<String>(string)
assertFalse(string.isEmpty()) // smart cast to a non-null String object
assertFalse(string.isEmpty()) // A smart cast to a non-nullable String object.
}

@Test
Expand Down

0 comments on commit 9920cf9

Please sign in to comment.