refactor: migrate public interface tests to tests/ tree - #60
Open
mzf11125 wants to merge 1 commit into
Open
Conversation
Move unit tests for public interfaces out of inline #[cfg(test)] modules into an integration tests/ directory that mirrors src/, as proposed in leanSig#53. Migrated modules: array, inc_encoding/target_sum, symmetric/prf/shake_to_field, symmetric/tweak_hash. Modules still using crate-private helpers stay inline (simd_utils, message_hash, tweak_hash/poseidon, tweak_hash_tree, signature, and the generalized_xmss instantiations which rely on cfg(test) test_templates). The test-only PoseidonMessageHash445 and PoseidonTweak44 aliases are defined locally in their integration test files because the originals are cfg(test) gated in the library. Closes leanEthereum#53
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Migrate unit tests for public interfaces out of inline
#[cfg(test)]modules into a dedicatedtests/directory that mirrorssrc/, as proposed in #53.What changed
tests/array.rs,tests/inc_encoding/target_sum.rs,tests/symmetric/prf/shake_to_field.rs, andtests/symmetric/tweak_hash.rs.src/.Cargo.tomlvia explicit[[test]]entries (Cargo only auto-discovers top-leveltests/*.rs).PoseidonMessageHash445andPoseidonTweak44aliases are defined locally in their integration test files, since the originals are#[cfg(test)]-gated in the library.What stayed inline (and why)
Tests that exercise crate-private helpers or
#[cfg(test)]-gatedtest_templatesremain inline:simd_utils(pub(crate)functions andPackedF),message_hash,tweak_hash/poseidon(compute_tree_layer/compute_tree_leavesare private),tweak_hash_tree(commit_openis private), and thesignature/generalized_xmssmodules.Tests
cargo testpasses (87 lib + 24 integration tests).cargo fmt -- --checkclean.cargo clippy --workspace --lib --examples --tests --benches --all-features -- -D warningsclean.Closes #53