aantron / bisect_ppx

Code coverage for OCaml and ReScript
http://aantron.github.io/bisect_ppx/demo/
MIT License
302 stars 60 forks source link

Support [@coverage off] for or-patterns #414

Closed nlsandler closed 1 year ago

nlsandler commented 1 year ago

You can use [@coverage off] to exclude pattern-matching cases, but this doesn't work for or-patterns. Here's a minimal example:

image

I would expect the case

| B | C -> (1 [@coverage off])

to be excluded from code coverage checking, the same as if both cases appeared individually or in a wildcard pattern. Issue #246 mentions that [@coverage off] should be able to exclude or-patterns.

I'm using OCaml version 4.14.1, dune version 3.7.1, bisect_ppx version 2.8.2.