Skip to content

Improve test coverage #2677

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

Open
ehuss opened this issue Apr 23, 2025 · 0 comments
Open

Improve test coverage #2677

ehuss opened this issue Apr 23, 2025 · 0 comments
Labels
A-testing-mdbook-iteself Area: mdbook's testsuite and unittests E-Help-wanted Experience: Help Needed

Comments

@ehuss
Copy link
Contributor

ehuss commented Apr 23, 2025

With the introduction of #2676, I'd like to make some progress on improving the test coverage. Some ideas for additions and improvements:

  • Try to get full coverage for all features in the integration testsuite. Some examples;
    • {{#playground example.rs editable}}
    • TOC fold tests
    • {{#title}}
    • All CLI flags (very few are currently covered)
    • init with git author configured
    • init check contents of .gitignore
    • Check that renderer or preprocessor uses PATH to locate mdbook-FOO
    • Any config option in book.toml that isn't in a test.
    • Tests for configuring book.toml via environment variables.
    • Hunt for error cases not covered (bonus to use coverage tools to drive this)
  • Check the cli help output for every command (see cli::help)
    • Fix the term.svg files so that they have color. Offhand I don't remember how to force color to enable.
  • The toc tests could use some review and cleanup.
    • Instead of using select, would it make sense to validate the contents of the raw HTML instead? (This is also hampered by the lack of the ability to prettify the HTML, which is otherwise all on one line.)
  • Can pretty_assertions be replaced with snapbox assert? Or should we just remove it?
@ehuss ehuss added A-testing-mdbook-iteself Area: mdbook's testsuite and unittests E-Help-wanted Experience: Help Needed labels Apr 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-testing-mdbook-iteself Area: mdbook's testsuite and unittests E-Help-wanted Experience: Help Needed
Projects
None yet
Development

No branches or pull requests

1 participant