Skip to content

Commit

Permalink
worked
Browse files Browse the repository at this point in the history
### What's done:
* worked
  • Loading branch information
diphtongue committed Dec 12, 2023
1 parent 058ff29 commit 74af4c1
Showing 1 changed file with 13 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -276,17 +276,19 @@ class KdocMethodsTest : LintTestBase(::KdocMethods) {
@Tag(WarningNames.KDOC_WITHOUT_THROWS_TAG)
fun `shouldn't add @throw if exception is in catch-block`() {
lintMethod(
"""
|class Example {
| override fun toString() = "example"
|
| override fun equals(other: Any?) = false
|
| override fun hashCode() = 42
|}
|
|fun main() {}
""".trimIndent()
"""
|fun parseInputNumber(onSuccess: (number: Int) -> Unit, onFailure: () -> Unit) {
| try {
| val input: Int = binding.inputEditText.text.toString().toInt()
| if (input < 0)
| throw NumberFormatException()
|
| onSuccess(input)
| } catch (e: NumberFormatException) {
| onFailure()
| }
|}
""".trimMargin()
)
}

Expand Down

0 comments on commit 74af4c1

Please sign in to comment.