zksecurity / noname

Noname: a programming language to write zkapps
https://zksecurity.github.io/noname/
179 stars 46 forks source link

Use Insta for test noname parser and analyzer #88

Open vuvoth opened 4 months ago

vuvoth commented 4 months ago

Motivation

We are facing a few problems when testing noname:

We can use Insta to help us create better test suites. The idea is to compare the compiler output with the expected snapshot output.

mimoo commented 4 months ago

do you think it would make sense to use it for the example tests? https://github.com/zksecurity/noname/blob/main/src/tests/examples.rs

as right now we save the files here: https://github.com/zksecurity/noname/blob/main/examples/fixture/asm/kimchi/arithmetic.asm and compare with the compiler output.

if so do you want to create a PR to do that :o ?

vuvoth commented 4 months ago

And for compiler output error too i.e. for this PR I don't know how and where I can create a test for this logic. With Insta, We only need to compare the compiler output and snapshot. 

if so do you want to create a PR to do that :o ?

Yes :D