Skip to content

Commit 6a9aec3

Browse files
committed
[conditional-exception] update2
1 parent a4bced1 commit 6a9aec3

File tree

1 file changed

+0
-2
lines changed

1 file changed

+0
-2
lines changed

core-kotlin-modules/core-kotlin-exceptions/src/test/kotlin/com/baeldung/conditionalThrowing/ConditionalThrowingUnitTest.kt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ class ConditionalThrowingUnitTest {
2929
val str = "a b c"
3030
assertThrows<IllegalArgumentException> {
3131
require(str.length > 10) { "The string is too short." }
32-
null.toString()
3332
}
3433

3534
val upperStr = str.also {
@@ -74,7 +73,6 @@ class ConditionalThrowingUnitTest {
7473
}
7574

7675
val nullIsValid: String? = null
77-
// we don't expect the exception
7876
assertThrows<MyException> {
7977
nullIsValid.takeIf { true } ?: throw MyException("The string is too short.")
8078
}

0 commit comments

Comments
 (0)