csv-ledger

csv_ledger

A project to learn zero-copy parsing and improve my Rust performance profiling and coverage tooling knowledge.



๐Ÿ›  Installation

cargo install csv_ledger

๐Ÿ”‹ Usage

Print output to console:

csv_ledger foo.csv

Save output to file:

csv_ledger --output output.csv foo.csv

To see helpful information:

csv_ledger --help

๐Ÿ“š Documentation

Further documentation can be found here.

๐Ÿ”ฌ Testing

To run tests for the CLI:

cargo test --features test_args

To run tests for the library:

cd lib && cargo test

๐Ÿ“ Code Coverage

This project aimed to have a near 100% code-coverage. Whilst Rust provides first-class error checking, it cannot easily protect against logic errors. With strong test coverage in combination with Rustโ€™s error checking, you can have a high degree of confidence. However, I have found that getting to 100% coverage can be very difficult whilst using llvm-cov. LLVMโ€™s coverage tooling is far more precise than other coverage tools that I have worked with in the past (such as Jest), requiring all lines, branches, derived traits and implementations to be covered.

A pre-generated coverage report can be found in: /coverage/html.

Run Coverage Locally

Setup

rustup component add llvm-tools-preview &&
cargo install cargo-llvm-cov

Usage

To create a coverage report:

cargo llvm-cov --features test_args

To debug a coverage report:

cargo llvm-cov --features test_args --html --output-dir coverage