unisonweb / unison

A friendly programming language from the future
https://unison-lang.org
Other
5.81k stars 271 forks source link

Add ANF and MCode serialization property tests #5414

Closed ChrisPenner closed 3 weeks ago

ChrisPenner commented 1 month ago

Overview

Adds Hedgehog tests to assert that get (put x) == x for MCode and ANF.

Having these would've saved me a few hours on the stack stuff, so figured I'd add it now since I'll be continuing to work in this area.

Implementation notes

Interesting/controversial decisions

Include anything that you thought twice about, debated, chose arbitrarily, etc. What could have been done differently, but wasn't? And why?

Test coverage

Yes it is.

Loose ends

Note: The ANF tests omit testing serialized Code, which is important, but takes a significant effort to generate because the serialization actually requires correct ANF terms which aren't trivial to generate. It would be nice to add this later.