You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now, we just assume that the decoding and encoding functions generated by Daedalus work (which they do, as far as we know...)
It would be really nice to leave the hypothetical world and have some unit tests that validate this hypothesis
Acceptance Criteria
Set up a testing framework that is able to test the code generated by Daedalus by running cargo test
Optionally, something that uses trybuild (see below) to test that the macro expansion compiles properly (this is otherwise a very arcane process)
Proposed Solution
Set up a mod tests in libs/daedalus/, testing the sub-functions that the macro calls. If you look into the architecture of gen_decode_data! and gen_encode_data!, you'll see that it's broken up into granular sub-functions (that are defined in libs/calypso-cangen/. It would be more realistic to test that these work as expected, rather than expanding and re-expanding the macro for every test. Maybe one or two tests that expand the macros and test that things work as expected, but otherwise, it would be better for the planet to not do that.
Description
Right now, we just assume that the decoding and encoding functions generated by Daedalus work (which they do, as far as we know...)
It would be really nice to leave the hypothetical world and have some unit tests that validate this hypothesis
Acceptance Criteria
Set up a testing framework that is able to test the code generated by Daedalus by running
cargo test
Optionally, something that uses
trybuild
(see below) to test that the macro expansion compiles properly (this is otherwise a very arcane process)Proposed Solution
Set up a
mod tests
inlibs/daedalus/
, testing the sub-functions that the macro calls. If you look into the architecture ofgen_decode_data!
andgen_encode_data!
, you'll see that it's broken up into granular sub-functions (that are defined inlibs/calypso-cangen/
. It would be more realistic to test that these work as expected, rather than expanding and re-expanding the macro for every test. Maybe one or two tests that expand the macros and test that things work as expected, but otherwise, it would be better for the planet to not do that.Here are some resources that may help:
trybuild
crate, which checks macro expansion likecargo expand
would (this would be handy for any big future changes to daedalus)The text was updated successfully, but these errors were encountered: