Skip to content

Conversation

cypriansakwa
Copy link
Contributor

@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*

  • I have tested the changes locally.
  • I have formatted the changes with Prettier and/or cargo fmt on default settings.
  • Code compiles and tests pass
  • New tests added where appropriate
  • No breaking changes introduced
  • PR description clearly explains the change
  • Linked to GitHub issue (if applicable)
  • Ready for review

@cypriansakwa
Copy link
Contributor Author

Hi @critesjosh, @signorecello . Please review the changes and let me know if anything needs adjustment. Thanks!

@critesjosh
Copy link
Collaborator

This Example is actually quite outdated. I am considering removing it with #44

@cypriansakwa
Copy link
Contributor Author

cypriansakwa commented May 29, 2025 via email

@critesjosh
Copy link
Collaborator

its been merged!

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.

2 participants