Open doganulus opened 3 years ago
The point of equal
in the test is to check for bitwise equality. This is a different use-case than operator==
. Otherwise, the tests would just use ==
instead of calling equal
:)
Ah equality over wires... ok, got it.
Ah equality over wires
Not exactly "wire" but rather, that the tests expect a bitwise equality instead of a semantic equality (which could invalidate the test). In other words this version of equal
is specifically for helping the tests ensure that the correct bit-patterns are produced. We could rename this if it would help (bitwise_equal
?)
Yes, renaming the helper function would prevent the confusion.
Currently some test cases use a helper
equal
function defined intest/test.hpp
to check the equality betweenjson::value
s.https://github.com/boostorg/json/blob/ee8d72d8502b409b5561200299cad30ccdb91415/test/test.hpp#L971-L1054
Its behavior is inconsistent with the
operator==
ofjson::value
as it distinguishes the cases ofint64
anduint64
.