tools tier

tools-test-assert-ratchet

Vacuous-test ratchet. Finds #test functions that construct values but contain no failure-capable operation (no assert/panic/unwrap/expect/?-propagation) — tests that pass even if the behavior they name is broken. New ones fail the build; the fix is a real assertion, never underscore-silencing.

Vacuous-test ratchet. Finds #test functions that construct values but contain no failure-capable operation (no assert/panic/unwrap/expect/?-propagation) — tests that pass even if the behavior they name is broken. New ones fail the build; the fix is a real assertion, never underscore-silencing.

Tiertools
Roleunclassified (baselined)
Pathcrates/tools/test-assert-ratchet
Edition2021
Targetstools-test-assert-ratchet, tools_test_assert_ratchet, ratchet_gate
Public items16 across 0 modules
Tests17

What it is for

Vacuous-test ratchet.

Finds test functions that cannot fail: they construct values, call builders, coerce to trait objects — and never perform a single failure-capable operation. No assert*, no panic!, no .unwrap()/.expect(), no ? propagation, no #should_panic. Such a test is green even when the behavior it names is broken; it only proves the code compiles, which the build already proves.

The mandated fix is a real assertion on the constructed value's behavior — never an underscore binding to silence the warning, and never deleting the test without replacing the coverage intent.

Same shape as tools-security-ratchet: scan the tree, compare against a committed baseline, fail only on findings the baseline does not contain. The baseline may only shrink.

Capabilities

Baseline

Vacuous-test ratchet.

Item
pub struct Baseline
Baseline :: fn load(path : & Path) -> Result <Self>
Baseline :: fn save(& self, path : & Path) -> Result <()>

Check

Vacuous-test ratchet.

Item
pub enum Check
Check :: fn all() -> & 'static Check
Check :: fn remedy(& self) -> & 'static str
Check :: fn fmt(& self, f : & mut fmt::Formatter <'_>) -> fmt::Result
fn check(repo_root : & Path, baseline : & Baseline) -> Result <Report>

Finding

Vacuous-test ratchet.

Item
pub struct Finding
Finding :: fn key(& self) -> String
fn scan_source(path : & str, src : & str, out : & mut Vec <Finding>)
fn scan(repo_root : & Path) -> Result <Vec <Finding>>

Report

Vacuous-test ratchet.

Item
pub struct Report
Report :: fn is_clean(& self) -> bool

TestFn

Vacuous-test ratchet.

Item
pub struct TestFn
fn tests_in(path : & str, src : & str) -> Vec <TestFn>

How to use it

No examples/ target and no doctest in this crate's rustdoc. The tests listed under Verification are the closest executable usage.

Module structure

No public modules: the crate root is its whole surface.

Public surface

`crate root`

ItemWhat it is
pub enum CheckWhich class of can't-fail test a finding belongs to.
Check :: fn all() -> & 'static Check
Check :: fn remedy(& self) -> & 'static strOne line on what to do about it, printed with every new finding.
Check :: fn fmt(& self, f : & mut fmt::Formatter <'_>) -> fmt::Result
pub struct FindingOne finding
Finding :: fn key(& self) -> String
pub struct BaselineThe committed set of known-acceptable findings.
Baseline :: fn load(path : & Path) -> Result <Self>
Baseline :: fn save(& self, path : & Path) -> Result <()>
pub struct ReportResult of a scan measured against a baseline.
Report :: fn is_clean(& self) -> bool
pub struct TestFnScan one already-cleaned source file for vacuous tests
fn tests_in(path : & str, src : & str) -> Vec <TestFn>Every #test in one source file, in the order they appear
fn scan_source(path : & str, src : & str, out : & mut Vec <Finding>)Scan a raw source file for vacuous tests.
fn scan(repo_root : & Path) -> Result <Vec <Finding>>Scan the tree rooted at repo_root and return every vacuous test.
fn check(repo_root : & Path, baseline : & Baseline) -> Result <Report>Scan and compare against the baseline.

No pub use re-exports: every item above is declared in this crate.

Boundary

Depends on no other workspace tier.

Shares tier tools with 84 other crates: tools-advisory-reach, tools-archive-guard, tools-artifact-scaffold, tools-ask-ai-core, tools-ask-ais, tools-ask-gemini, tools-book, tools-book-report, … (84 total).

_What this crate deliberately does NOT own is a judgment. No committed registry records one for it, so none is stated here._

Where it sits

Tier (ontology)tools
Architectural role (taxonomy)unclassified (baselined)
Locationcrates/tools/test-assert-ratchet
Vocabulary in force (lexicon)current

Dependencies

Runtime, from outside the workspace.

CrateRequirementFeaturesOptionalOnly on
anyhow^1noalways
serde^1derivenoalways
serde_json^1noalways

Development. None.

Build. None.

Depended on by. 1 workspace crate.

Signal flow — what reaches this crate, and what it reaches.

flowchart LR
  n_tools_corpus["tools-corpus"] -->|uses| SELF
  SELF["tools-test-assert-ratchet"]
  classDef self fill:#1f883d,stroke:#1f883d,color:#fff;
  class SELF self;

Feature flags

No Cargo features are defined: every capability is unconditional, so no consumer can receive a half-wired crate.

Targets

KindNameSource
bintools-test-assert-ratchet`src/main.rs`
libtools_test_assert_ratchet`src/lib.rs`
testratchet_gate`tests/ratchet_gate.rs`

Error model

No public error type was detected: no public item declares a type named *Error, and no public signature returns one.

Operational characteristics

PropertyEvidence
async public surfacenone detected
async runtimenone detected
database accessnone detected
network I/Onone detected
unsafe codenone detected
environment variablesyes

No unsafe block, unsafe fn, unsafe impl or unsafe trait was found by the parser anywhere in this crate's source.

Configuration

VariableRead in
CARGO_MANIFEST_DIRsrc/main.rs

1 workspace crate depends on this one: tools-corpus.

Verification

KindCount
Unit tests16
Integration tests1
Examples0
Doctests0

Evidence by module. How often each public module is named by something executable.

ModuleTestsExamplesConsumers
crate root907

What the tests establish, by name:

Documentation coverage

MeasureDocumentedTotal
Public items with rustdoc1016
Public modules with a //! block00
pie showData
    title Public items with rustdoc
    "Documented" : 10
    "No rustdoc detected" : 6

Metrics

MetricValue
Rust source files2
Source lines1114
Code lines959
Public API items16
Public modules0
Tests17
Examples0
Cargo features0
Direct runtime dependencies3
Workspace reverse dependencies1
pie showData
    title Public API by kind
    "enum" : 1
    "function" : 4
    "method" : 7
    "struct" : 4
pie showData
    title Rust source composition
    "Code" : 959
    "Blank or comment" : 155

Generation

Rendered by tools-corpus corpus readme from repository evidence alone, renderer schema 2, lexicon current. No model, network service or database was consulted. Regenerate with tools-corpus corpus readme --write; verify with --check.

All tools · Manual