Skip to content

df: add unit tests for internal helper functions - #3167

Merged
sylvestre merged 2 commits into
uutils:mainfrom
jfinkels:df-unit-tests
Mar 5, 2022
Merged

sylvestre merged 2 commits into
uutils:mainfrom
jfinkels:df-unit-tests

Conversation

@jfinkels

Copy link
Copy Markdown
Collaborator

Unlike other utilities like head or seq, the output of the df program may be different in each environment in which it is run, and even each time it is run (since filesystem usage may change rapidly). This makes it difficult to produce black box tests, as in the tests/by-utils/test_*.rs files. But we can still provide tests for the internal components of df using mock data. This pull request starts to address this by adding unit tests in the df.rs file for internal helper functions mount_info_lt(), is_best(), is_included(), and filter_mount_list().

@jfinkels
jfinkels force-pushed the df-unit-tests branch 3 times, most recently from 9f4005d to fded226 Compare February 22, 2022 23:48
Add unit tests in the `df.rs` file for internal helper functions
`mount_info_lt()`, `is_best()`, `is_included()`, and
`filter_mount_list()`.
@sylvestre
sylvestre merged commit 3fb36d0 into uutils:main Mar 5, 2022
@jfinkels
jfinkels deleted the df-unit-tests branch March 12, 2022 18:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants