Skip to content

test(core): cover error/validation branches in ar/pattern.rs + kpm/freak/pyramid.rs (5 lines) #224

Description

@kalwalt

Summary

Codecov flagged 5 uncovered lines on the v0.8.0 release PR (#223) — patch coverage 97.98%. These are pre-existing gaps surfaced by the release diff, not a regression. Tracking them here as a post-release test follow-up.

File Patch % Missing
crates/core/src/ar/pattern.rs 70.00% 3 lines
crates/core/src/kpm/freak/pyramid.rs 88.89% 2 lines

Exact lines: see the Codecov report for #223.

Likely culprits (error/validation branches)

These files are dominated by arlog_e! + return Err(...) guard clauses that no test exercises:

  • ar/pattern.rs — activate/deactivate/index guards, e.g.:

    • ar_patt_activate: "Invalid pattern index" / "Pattern not loaded" (pattern.rs:275-302)
    • ar_patt_load_from_buffer: parse-failure / unexpected-EOF paths (pattern.rs:113-118)
  • kpm/freak/pyramid.rsPyramid::build validation, e.g.:

    • ZeroLevels / InvalidScaleFactor / EmptyImage / LevelTooSmall (pyramid.rs:150-185)

    Note: pyramid.rs is the box-filter Pyramid kept as a reference but not wired into the live pipeline (chore(kpm): decide fate of unused BoxFilterPyramid8u (wire in or remove) #203), so its branches are naturally under-exercised.

Suggested fix

Add small unit tests asserting the Err variants for each guard (cheap, deterministic, no image pipeline needed) — mirrors the edge-case tests added for M9 coverage in #177. Target: bring both files' patch coverage to 100% and nudge the ar + kpm::freak module totals up.

Related

Metadata

Metadata

Assignees

Type

Fields

No fields configured for Task.

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions