Wrong assertion for `-0`
Gopikrishna19 opened this issue · comments
Gopikrishna Sathyamurthy commented
the following code fails:
const a = 0;
expect(-a).equals(0);
while doing a shallow equals passes:
const a = 0;
expect(-a).shallow.equals(0);
Is this an intended feature? shouldn't '-0' be equal to '0', since javascript tells that 0 === -0
is true? Please let me know. Thanks
Gopikrishna Sathyamurthy commented
I also noticed that this feature is not reflected for a +0
:
const a = 0;
expect(+a).shallow.equals(0); //passes
expect(+a).equals(0); //passes
Colin Ihrig commented
Gopikrishna Sathyamurthy commented
@cjihrig Thanks and done :)
lock commented
This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.