dir-path-2-tree · Rust

One task in several forms: recursive, iterative, with an explicit stack and with a depth limit - measured, tested, and shown where recursion overflows the stack.

Code coverage, this run

Measured with cargo llvm-cov (source-based, LLVM) over all tests of the crate.

84.7 %lines: 149 of 176
78.3 %functions: 18 of 23
84.3 %regions: 311 of 369
FileLinesFunctionsRegions
src/lib.rs90.3 % (149/165)81.8 % (18/22)90.7 % (311/343)
src/main.rs0.0 % (0/11)0.0 % (0/1)0.0 % (0/26)

The full report, line by line

What the numbers leave out: src/main.rs runs only with cargo run; the print_ functions, thin wrappers that write to the console, run in doc tests, which cargo-llvm-cov does not count by default; and a child process of the stack overflow demonstration aborts before it can write its profile - the routines it crashes in are covered by the other tests.