Skip to content

Commit

Permalink
Merge pull request #1032 from yadavan88/empty-array-kotlin
Browse files Browse the repository at this point in the history
create empty array
  • Loading branch information
Maiklins authored Jul 23, 2024
2 parents 974ff5a + 5284950 commit 4abc9fb
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,4 +82,16 @@ class ArrayInitializationUnitTest {
val intArray = intRange.toIntArray()
assertEquals(0, intArray.size)
}

@Test
fun `Given a type, When using emptyArrayOf(), then create an empty array`() {
val emptyStringArray = emptyArray<String>()
assertEquals(0, emptyStringArray.size)
}

@Test
fun `When using intArrayOf(), then create an empty int array`() {
val emptyIntArray = intArrayOf()
assertEquals(0, emptyIntArray.size)
}
}

0 comments on commit 4abc9fb

Please sign in to comment.