Merge pull request #9397 from alimate/KTLN-40

KTLN-40: Added Elvis Operator
This commit is contained in:
Eric Martin 2020-06-04 23:21:38 -05:00 committed by GitHub
commit 2716a2a6d0
1 changed files with 8 additions and 0 deletions

View File

@ -21,4 +21,12 @@ class TernaryOperatorTest {
}
assertEquals("yes", result)
}
@Test
fun `using elvis`() {
val a: String? = null
val result = a ?: "Default"
assertEquals("Default", result)
}
}