QuantumBFS/YaoBlocksQASM.jl

use expression compare instead of print as string

Roger-luo opened this issue · 1 comments

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])"

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