kerelape/reikai

Improve `Equality` tests

Closed this issue · 6 comments

@Masynchin looks like it won't work if an element of Xor is longer than 1 byte.

Originally posted by @kerelape in #39 (comment)

Test with differently long objects.

Context: expected behaviour for boolean object is that 0 (any length in bytes) is false and everything that is not 0 is true. Note that a boolean can be any size, this is why we have to compare them using BigInteger.

@Masynchin can you help with this?

Also the tests must be fixed, because they are not right. If Equality is an integer like this 00_00_00_01, then, however, the tests will treat it as false. This behaviour is not correct

0 (any length in bytes) is false

So, byteArrayOf(0, 0, 0, 0) is false?

0 (any length in bytes) is false

So, byteArrayOf(0, 0, 0, 0) is false?

@Masynchin yes and if any of those bytes is not 0, it's true

@Masynchin can you help with this?

Will be available by about 2022-07-24T15:00:00+0000.

@Masynchin note that the package name has changed to io.github.kerelape.reikai