I have a function that return [[]], and I want to test the result as unit test.
But I found that the expression [[]] == [[]] return false.
Here a simple test code:
# [[]] == [[]];;
- : bool = false
Can someone explain me why this expression is evaluated as false?
Thanks.
Use
=since you have structural equality for comparing two values:Because
==is reference equality, it only returns true if you refer to the same memory location: