Skip to content

Add 158 unit tests for 6 previously untested modules#4

Merged
undivisible merged 2 commits into
masterfrom
devin/1782092871-add-unit-tests-coverage
Jun 22, 2026
Merged

Add 158 unit tests for 6 previously untested modules#4
undivisible merged 2 commits into
masterfrom
devin/1782092871-add-unit-tests-coverage

Conversation

@devin-ai-integration

Copy link
Copy Markdown
Contributor

Summary

Adds #[cfg(test)] modules to the 6 largest source files that had zero test coverage, bringing 158 new tests online across both in-cli and compiler/rust-driver.

Modules covered (by size):

File Lines Tests Key coverage
core_opt.rs 1315 56 fold_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_refs
core_ir.rs 441 30 Span construction/Display, FloatVal NaN 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_id fallback chain, identity_report, interrupt fn registry
rust-driver/.../core/lib.rs 658 27 IrType::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/RuntimeMetrics serde
compiler/core.rs 277 15 IrType::size_bytes for all widths + Named/Array/Slice → None, IrValue::ZERO, IrInstruction::new/with_imm, IrFunction::fresh_value monotonicity, IrModule::get_function/get_function_mut/add_string
boundary_ir.rs 247 16 BoundaryModule::default invariants, compute_layout_hash determinism + blake3 prefix, different-content → different-hash, serde round-trips for BoundaryRepr/BoundaryTransfer/BoundaryOwnership/BoundaryModule/ComponentMetadata, CompileArtifact::from_semantic/with_boundary
compile_error.rs 117 14 Display for all 6 categories, ErrorCategory field check, From<String>/From<&str>/From<io::Error>, span presence/absence, CompileError as std::error::Error

All 158 new tests pass. The 6 pre-existing failures (tree_front::extract zig/ruby/julia, language_gates, v_native::parallel) are unchanged.

Link to Devin session: https://app.devin.ai/sessions/156eee52751c4c25aab453f09f8c10ed
Requested by: @undivisible

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>
@undivisible undivisible self-assigned this Jun 22, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@undivisible undivisible merged commit e47da1f into master Jun 22, 2026
10 of 12 checks passed
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.

1 participant