is it safe to call ```assertEquals(byteArray, othe...
# stdlib
d
is it safe to call
Copy code
assertEquals(byteArray, otherByteArray)
and receive the expected result? Or do I need to call
Copy code
Arrays.equals()
instead?
i
You can use
array contentEquals otherArray
to compare two arrays by content and then assert that the result is true. Or you can wrap these arrays in lists and compare that lists:
assertEquals(byteArray.asList(), otherByteArray.asList())
d
Thank you, that's exactly the solution I was looking for!
This is much nicer:
Copy code
assertTrue(bytes contentEquals image!!.data)
i
The disadvantage of that is when it fails, you'll get a message, something like "expected true, got false".