Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

df: add unit tests for internal helper functions #3167

Merged
merged 2 commits into from
Mar 5, 2022

Conversation

jfinkels
Copy link
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