Add 158 unit tests for 6 previously untested modules#4
Merged
Conversation
Cover the modules with zero test coverage: - core_opt.rs: constant folding, algebraic simplification, DCE, constant propagation, dead function elimination, inlining, x86_64 peephole optimizer, instruction length decoder (56 tests) - core_ir.rs: Span, FloatVal, Typ, MatchPattern parsing, UnifiedModule identity resolution, interrupt fn registry (30 tests) - boundary_ir.rs: BoundaryModule layout hash, serde round-trips, CompileArtifact constructors, ComponentMetadata (16 tests) - compile_error.rs: Display impls, error categories, From conversions, span handling (14 tests) - compiler/core.rs: IrType size/classification, IrValue, IrInstruction, IrBasicBlock, IrFunction, IrModule (15 tests) - compiler/rust-driver/crates/core: IrType, IrValue, ComponentSpec, ComponentMetadata, Diagnostic, CompilerConfig, pipeline types (27 tests) Total: 158 new tests across 6 files. All pass alongside the existing 764 passing tests (6 pre-existing failures unchanged). Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
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.
Summary
Adds
#[cfg(test)]modules to the 6 largest source files that had zero test coverage, bringing 158 new tests online across bothin-cliandcompiler/rust-driver.Modules covered (by size):
core_opt.rsfold_expr(all arithmetic, bitwise, comparison, logical, unary),simplify_expr(identity/absorber for every op + double-neg/not),dce_body,propagate_in_body,remove_dead_functions,inline_small_functions,has_cf,peephole_x86_64,x86_64_insn_length,detect_ptr_refscore_ir.rsSpanconstruction/Display,FloatValNaN equality,MatchPattern::parse(wild/rest/bool/int/string/ident/tuple/array/struct/shorthand/case-prefix/trailing-colon/empty),split_match_pat_args,UnifiedModule::effective_module_idfallback chain,identity_report, interrupt fn registryrust-driver/.../core/lib.rsIrType::size_bytes/is_integer/is_float,ComponentSpec::host_triple/object_format/is_freestanding,ComponentMetadata::from_spec/JSON round-trip,Diagnostic::error/warning,CompilerConfig::new,ChangeEvent/BuildTask/RuntimeMetricsserdecompiler/core.rsIrType::size_bytesfor all widths + Named/Array/Slice →None,IrValue::ZERO,IrInstruction::new/with_imm,IrFunction::fresh_valuemonotonicity,IrModule::get_function/get_function_mut/add_stringboundary_ir.rsBoundaryModule::defaultinvariants,compute_layout_hashdeterminism + blake3 prefix, different-content → different-hash, serde round-trips forBoundaryRepr/BoundaryTransfer/BoundaryOwnership/BoundaryModule/ComponentMetadata,CompileArtifact::from_semantic/with_boundarycompile_error.rsDisplayfor all 6 categories,ErrorCategoryfield check,From<String>/From<&str>/From<io::Error>, span presence/absence,CompileErrorasstd::error::ErrorAll 158 new tests pass. The 6 pre-existing failures (
tree_front::extractzig/ruby/julia,language_gates,v_native::parallel) are unchanged.Link to Devin session: https://app.devin.ai/sessions/156eee52751c4c25aab453f09f8c10ed
Requested by: @undivisible