pub fn render_text(survey: &Survey, depth: Depth) -> StringExpand description
Render the survey as indented text. Heuristic values (test counts) wear a
trailing ~; a closing legend explains the marks.
ยงExamples
use coding_tools::survey::{render_text, CrateNode, Counts, Depth, GroupKind, Survey};
let survey = Survey {
group: GroupKind::CargoCrate,
name: "demo".into(),
root: "/demo".into(),
crates: vec![CrateNode {
name: "demo".into(),
version: "0.1.0".into(),
counts: Counts { files: 2, lines: 30, words: 40, chars: 300, tests: 3 },
test_targets: 1,
bench_targets: 0,
modules: vec![],
}],
};
let text = render_text(&survey, Depth::Crate);
assert!(text.starts_with("crate demo"));
assert!(text.contains("tests 3~"));
assert!(text.contains("test-targets 1"));