Add additional tests for main function in foundry-voting #43
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@critesjosh, @signorecello Added test verifying successful execution with valid inputs
Description
Extended the test suite for the main circuit in the foundry-voting Noir example to ensure robustness, input validation, and future maintainability.
Problem*
The main circuit had limited test coverage, making it harder to catch edge cases or regressions, especially regarding deterministic behavior and input validation.
Resolves
N/A (tests added as a general improvement)
Summary*
Added test to ensure deterministic output for same inputs
Added test to confirm vote input does not affect output (current behavior)
Added (commented) test for invalid Merkle root to check input validation (expected failure)
Improved test coverage and documentation to enhance robustness and maintainability
Additional Context
This PR builds on top of the existing foundry-voting test framework and aims to help future contributors understand assumptions and circuit behavior.
The invalid Merkle test is commented out to prevent test failure, but it serves as documentation of a current limitation.
PR Checklist*
cargo fmt
on default settings.