Created
November 18, 2018 06:35
-
-
Save mirasrael/2f85c60dc44710f65199d72fdae73cdc to your computer and use it in GitHub Desktop.
Asserts for Kotlin lessons
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
import kotlin.test.assertEquals | |
/** | |
* Date: 11/18/2018 | |
* Time: 09:25 | |
*/ | |
fun assertArrayEquals(expected: LongArray, actual: LongArray) { | |
assertEquals(expected.size, actual.size, "Arrays have different size: ${expected.size} != ${actual.size}") | |
var i = 0 | |
while (i < expected.size) { | |
assertEquals(expected[i], actual[i], "Array elements at index: $i different: ${expected[i]} != ${actual[i]}") | |
i++ | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment