AssertEqual and AssertEqualtoResult may show that two expressions are different, when they are seemingly the same. This happens, for example, when a number is returned as a symbol by some operation and compared to a grounded number.
This can be reproduced in Python, e.g.
from hyperon import MeTTa, S, E
m = MeTTa()
m.space().add_atom(E(S("A"), S("2")))
print(m.run("! (assertEqual (match &self (A $x) $x) 2)"))
It will print
Expected: [2]
Got: [2]
Missed result: 2
It would be useful if asserts analyze the situation deeper. They make show excessive both expected and actual results, and either analyze their difference in more detail, or show the results in more detail.
AssertEqual
andAssertEqualtoResult
may show that two expressions are different, when they are seemingly the same. This happens, for example, when a number is returned as a symbol by some operation and compared to a grounded number.This can be reproduced in Python, e.g.
It will print
It would be useful if asserts analyze the situation deeper. They make show excessive both expected and actual results, and either analyze their difference in more detail, or show the results in more detail.