refactor(assembly): split tests.rs into thematic test modules - #3379
Open
haileymarshall wants to merge 1 commit into
Open
refactor(assembly): split tests.rs into thematic test modules#3379haileymarshall wants to merge 1 commit into
haileymarshall wants to merge 1 commit into
Conversation
Split the 7.6k-line tests.rs into crates/assembly/src/tests/ with one module per existing section header, and break the MAST TESTS section into thematic modules (kernels, forest merging, linking, packages, symbol resolution, etc.). Shared imports, helpers, and the assert_assembler_diagnostic macro stay in tests/mod.rs; test code is moved verbatim. Insta snapshots are renamed to their new module paths, and the orphaned nested_blocks_hash.snap (its assertion was removed in 0xMiden#3142) is deleted.
haileymarshall
force-pushed
the
refactor-split-assembly-tests
branch
from
July 15, 2026 14:02
1f93158 to
f649fda
Compare
huitseeker
reviewed
Aug 7, 2026
huitseeker
left a comment
Collaborator
There was a problem hiding this comment.
So sorry about the late review. This LGTM, but needs a rebase: since the PR branched, next added four tests, removed one, and changed two function bodies. Those changes must be deliberately moved into the new modules during a refresh.
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.
Closes #3065
Rationale
crates/assembly/src/tests.rshad grown to 7.6k lines / 233 tests, which makes it slow tonavigate, causes unrelated changes to collide in the same file, and buries which area a
failing test belongs to. #3065 asks for it to be split up now that #3073 has landed. Smaller
thematic modules make it obvious where a new test belongs and keep future diffs scoped to the
area they touch.
What changed
Splits
tests.rsintocrates/assembly/src/tests/:// SECTIONheader (simple programs, libraries, constants,assertions, imports, errors, etc.). Test code is moved verbatim.
theme:
mast,kernels(incl. syscall resolution),forest_merge,linking_imports,package_surface,link_diagnostics,cross_module_constants,link_cycles,import_regressions,symbol_resolution,link_expansion,num_locals,misc_regressions. Happy to regroup if you'd prefer different boundaries.assert_assembler_diagnostic!macro live intests/mod.rs;each module starts with
use super::*;.source:headersupdated. The orphaned
nested_blocks_hash.snapis deleted (its assertion was removedin Simplify MastForestBuilder with builder-local refs #3142).
CHANGELOG.mdentry.Test plan / how to review
the old
// SECTIONboundaries should show only relocation plus theuse super::*;preamble.cargo test -p miden-assemblyruns the same 233 tests as beforethe split (plus 1 in the pre-existing
package.rs), all passing.git mv-renamed, so the diff shows them as renames; only theirsource:headers changed.
cargo fmt(stable and nightly) andcargo clippy -p miden-assembly --all-targets --all-featuresare green.