meta: improve library and cli tests coverage #33
Labels
ci
Continuous Integration related (GitHub actions, precommit, …)
good first issue
Good for newcomers
hacktoberfest
Issue that is created for the Hacktoberfest event
What
Currently, only a few functions are tested, which may lead to uncaught breaking changes in the future.
With the issue, I hope to motivate the need of creating more tests to extend the actual coverage.
How to
Testing library
For testing individual functions, you can create tests either inside tests modules, e.g., with
mod tests
(ortest_my_name
):languagetool-rust/src/lib/server.rs
Lines 562 to 594 in 6cf960a
or inside function's documentation, e.g, with examples:
languagetool-rust/src/lib/server.rs
Lines 24 to 47 in 6cf960a
for testing multiple functions at the same time, i.e., the integration of multiple functions, please write tests in the tests folder.
Testing the CLI
Testing the CLI is the same as for the library, but everything is currently defined the
src/bin.rs
. So you should testbuild_cli()
with different arguments and check that it correctly fails or succeed for some configurations. Seeclap::Command::try_get_matches_from
.The text was updated successfully, but these errors were encountered: