Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AssertEqual[toResult] may analyze difference in detail #654

Open
Necr0x0Der opened this issue Apr 9, 2024 · 0 comments
Open

AssertEqual[toResult] may analyze difference in detail #654

Necr0x0Der opened this issue Apr 9, 2024 · 0 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@Necr0x0Der
Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant