noname icon indicating copy to clipboard operation
noname copied to clipboard

Use Insta for test noname parser and analyzer

Open vuvoth opened this issue 1 year ago • 2 comments

Motivation

We are facing a few problems when testing noname:

  • Can't test fails to compile messages cli.
  • Can't ensure consistency when updating parser or analyzer error messages.

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

vuvoth avatar Jun 03 '24 14:06 vuvoth

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 ?

mimoo avatar Jun 03 '24 14:06 mimoo

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

vuvoth avatar Jun 03 '24 14:06 vuvoth