Skip to content

Conversation

mtlynch
Copy link

@mtlynch mtlynch commented Oct 12, 2025

No description provided.

@mtlynch
Copy link
Author

mtlynch commented Oct 12, 2025

I know toHex isn't the most interesting function to test, but this is just a proof of concept of the idea of unit testing in this project.

Unit testing can make it significantly easier and faster to catch bugs, as we can exercise logic on regular desktops and in Github Actions without having to push code to a LoRa device and test it. It also allows maintainers to see immediately in Github Actions if a change caused a regression in tests.

I chose toHex just because it's a simple function with no external dependencies, though because it's defined in a file that also includes dependencies on Stream.h and SHA256.h, we need to mock out those dependencies.

@mtlynch mtlynch changed the base branch from main to dev October 12, 2025 15:08
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

Successfully merging this pull request may close these issues.

1 participant