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

use expression compare instead of print as string #11

Open
Roger-luo opened this issue May 20, 2021 · 1 comment
Open

use expression compare instead of print as string #11

Roger-luo opened this issue May 20, 2021 · 1 comment

Comments

@Roger-luo
Copy link
Member

use the isapprox implemented here: https://github.com/QuantumBFS/OpenQASM.jl/blob/master/test/runtests.jl#L325

the printing doesn't guarantee equivalence

@test "$(ast.prog[i])" == "$(ast1.prog[i])"

@Sov-trotter
Copy link
Member

Sov-trotter commented May 21, 2021

Sure. There seems to be one minor issue with using that.
eg:
image

So isapprox fails here. We might need to increase the tolerance values. Other way is figure out a way to ensure proper generation of RBNF.Token. But I don't think we can account for parameters like colno, lineno
.
Eg: Currently I just create it using constructors which leaves out other parameters(the zeros)
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants