Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Daedalus] - Unit Tests #96

Open
harrison-e opened this issue Jan 11, 2025 · 0 comments
Open

[Daedalus] - Unit Tests #96

harrison-e opened this issue Jan 11, 2025 · 0 comments

Comments

@harrison-e
Copy link
Contributor

harrison-e commented Jan 11, 2025

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 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.

Here are some resources that may help:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant