MCPcopy
hub / github.com/idank/explainshell / test_shadowed_duplicate

Method test_shadowed_duplicate

tests/test_db_check.py:89–103  ·  view source on GitHub ↗

Two manpages with same name+section+distro should be flagged.

(self, store, db_path)

Source from the content-addressed store, hash-verified

87 assert any("unreachable manpage" in msg for msg in warnings)
88
89 def test_shadowed_duplicate(self, store, db_path):
90 """Two manpages with same name+section+distro should be flagged."""
91 store.add_manpage(_make_manpage("ps", "1"), _make_raw())
92 # Directly insert a second one with same name/section/distro but different source
93 store._conn.execute("PRAGMA foreign_keys = OFF")
94 store._conn.execute(
95 "INSERT INTO parsed_manpages(source, name, options, aliases) "
96 "VALUES (?, ?, '[]', '[]')",
97 ("ubuntu/26.04/1/procps-ps.1.gz", "ps"),
98 )
99 store._conn.commit()
100 store._conn.execute("PRAGMA foreign_keys = ON")
101 issues = db_check(db_path)
102 errors_list = [msg for sev, msg in issues if sev == "error"]
103 assert any("shadowed duplicate" in msg for msg in errors_list)
104
105 def test_positional_on_flagged_option(self, store, db_path):
106 """Options with short/long flags should not have positional set."""

Callers

nothing calls this directly

Calls 3

add_manpageMethod · 0.80
_make_manpageFunction · 0.70
_make_rawFunction · 0.70

Tested by

no test coverage detected