Test helpers and unit tests (#26)

* Implement a few utility functions for tests

Most tests would require a test file hierarchy instead of operating on a
live system.

* Add unit tests for `tab::scan_path`

Tests:
* Works on a valid path
* Returns an empty Vec on an invalid directory
* Returns an empty Vec for an empty directory

I also implemented a few test helpers that may be useful for other
unit tests.

* Less spammy test logs and placate Clippy.
This commit is contained in:
Joshua Megnauth 2024-02-01 16:29:10 +00:00 • committed by GitHub
parent 60eeb724d1
commit d6c58991c0
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 228 additions and 0 deletions

View file

@ -47,3 +47,10 @@ debug = true
[target.'cfg(unix)'.dependencies]
fork = "0.1"
[dev-dependencies]
# cap-std = "3"
# cap-tempfile = "3"
fastrand = "2"
tempfile = "3"
test-log = "0.2"