Merge pull request #9397 from alimate/KTLN-40
KTLN-40: Added Elvis Operator
This commit is contained in:
commit
2716a2a6d0
|
@ -21,4 +21,12 @@ class TernaryOperatorTest {
|
|||
}
|
||||
assertEquals("yes", result)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun `using elvis`() {
|
||||
val a: String? = null
|
||||
val result = a ?: "Default"
|
||||
|
||||
assertEquals("Default", result)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue