-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
55c026e
commit 705d792
Showing
2 changed files
with
7 additions
and
14 deletions.
There are no files selected for viewing
19 changes: 6 additions & 13 deletions
19
mutation-testing/src/main/kotlin/org/testingplayground/MyImpl.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,11 @@ | ||
package org.testingplayground | ||
|
||
class MyImpl { | ||
fun doSomething(a: Int, b: Int): String { | ||
if (a < 0 || b < 0) { | ||
return "Either A or B are negative" | ||
} | ||
if (a == 0 && b == 0) { | ||
return "Both A and B are zero" | ||
} | ||
if (a > b) { | ||
return "A is greater than B" | ||
} | ||
return if (b > a) { | ||
"B is greater than A" | ||
} else "A and B are equal" | ||
fun doSomething(a: Int, b: Int) = when { | ||
(a < 0 || b < 0) -> "Either A or B are negative" | ||
(a == 0 && b == 0) -> "Both A and B are zero" | ||
(a > b) -> "A is greater than B" | ||
(b > a) -> "B is greater than A" | ||
else -> "A and B are equal" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters