# Mutants that NO test can kill, with the reason each one is unreachable by any # test that could be written. # # WHY THIS IS AT THE WORKSPACE ROOT AND NOT PER-CRATE. Measured against # cargo-mutants 27.1.0: the config is read from the workspace root and nowhere # else. A `crates/shop-vt/.cargo/mutants.toml` is silently ignored -- both # `cargo mutants -p shop-vt` from here and `cargo mutants` run inside the crate # directory listed the full 191 mutants with it in place, and 170 with the same # file here. So one file covers the workspace, and every pattern is qualified by # the type it belongs to (`Perform::`, `Parser::`) rather than relying on scope. # # THE BAR IS IMPOSSIBILITY, NOT COST. A mutant that a test could kill, where # nobody has written that test, does not belong here however unappealing the # test looks. It stays a visible survivor with a GoingsOn task against it. The # two classes are easy to conflate and the difference is the whole value of the # number: an exclusion list that also absorbs "not worth it" reports zero while # real coverage gaps sit underneath it. # # The patterns are regexes, so `+`, `*`, `|` and `.` need escaping. A bare `||` # is an empty alternation and silently excludes every mutant in the crate. exclude_re = [ # ===================== shop-vt ===================== # --- Default trait method bodies ------------------------------------- # # Every `Perform` method has a default body of the form `let _ = args;`, # which exists only to name the arguments so an implementor that wants none # of them compiles without warnings. Replacing that body with `()` is the # same program: the discard has no effect and the method returns `()` # either way. What the parser calls is always the implementor's override, # and no test can observe a default that does nothing being replaced by # nothing. "replace Perform::print with \\(\\)", "replace Perform::execute with \\(\\)", "replace Perform::csi_dispatch with \\(\\)", "replace Perform::esc_dispatch with \\(\\)", "replace Perform::osc_dispatch with \\(\\)", "replace Perform::hook with \\(\\)", "replace Perform::put with \\(\\)", "replace Perform::apc_dispatch with \\(\\)", # --- Match arms that fall through to an identical `_ => {}` ----------- # # The state handlers are written to mirror the DEC parser's transition # tables arm for arm, including the arms whose action is "nothing". Those # arms document a byte range the spec calls out; deleting one lets the same # bytes reach the handler's own `_ => {}`, which does the same nothing. The # arms are kept because a reader checking this file against vt100.net needs # to find them, and excluded because no observation distinguishes them. # # 0x7F (DEL) is ignored in every state that names it, which is the reason # this list is mostly 0x7F. "delete match arm 0x80\\.\\.= 0xBF in Parser::ground", "delete match arm 0x7F in Parser::escape$", "delete match arm 0x7F in Parser::escape_intermediate", "delete match arm 0x7F in Parser::csi_entry", "delete match arm 0x7F in Parser::csi_param", "delete match arm 0x7F in Parser::csi_intermediate", "delete match arm 0x7F in Parser::dcs_entry", "delete match arm 0x7F in Parser::dcs_param", "delete match arm 0x7F in Parser::dcs_intermediate", # The three DCS prelude states discard C0 controls rather than executing # them (unlike the CSI states, which execute). The arm's body is `{}` and # the fall-through is `{}`. "delete match arm 0x00\\.\\.= 0x17 \\| 0x19 \\| 0x1C\\.\\.= 0x1F in Parser::dcs_entry", "delete match arm 0x00\\.\\.= 0x17 \\| 0x19 \\| 0x1C\\.\\.= 0x1F in Parser::dcs_param", "delete match arm 0x00\\.\\.= 0x17 \\| 0x19 \\| 0x1C\\.\\.= 0x1F in Parser::dcs_intermediate", # --- Clearing state that is already clear ----------------------------- # # `ESC ESC` in the Escape state. Every route into Escape calls `clear()` on # the way in (Ground, Utf8, DcsIgnore, DcsPassthrough, OscString and # ApcString all do), and the only arm inside Escape that writes # intermediates or parameters is 0x20..=0x2F, which leaves Escape as it # writes. So the parser is never in Escape holding anything to clear, and # deleting the arm leaves the byte to a `_ => {}` that also holds the state # still. Kept because the DEC table names the transition. "delete match arm 0x1B in Parser::escape$", # --- A reset that its partner has always already done ----------------- # # `apc_start` clears `apc_buf` and `string_overflow` on the way into an APC, # SOS or PM body. Every route out of `ApcString` -- the BEL arm and the ESC # arm, which are the only two -- calls `apc_end`, which clears both and # shrinks the buffer besides. So the parser is never in Escape about to open # a string while holding a previous one's bytes or its overflow flag, and # the opening clear has nothing to clear. Kept because the pairing is what # makes that true, and a third exit added later would need it. # # `osc_start` is NOT here and is caught: it also pushes the first parameter # placeholder, which is work nothing else does. "replace Parser::apc_start with \\(\\)", ]