rust-lang / rust

Empowering everyone to build reliable and efficient software.
https://www.rust-lang.org
Other
98.32k stars 12.72k forks source link

rustdoc: Add more test coverage #91113

Open camelid opened 2 years ago

camelid commented 2 years ago

Summary

Currently, rustdoc doesn't have much test coverage, but it does have a lot of edge cases. We would like to have more test coverage, so we can improve the code with less risk of introducing bugs.

It's even helpful to add tests for incorrect behavior since it will help us find, fix, and test the fixes for bugs.

What to test

How to test

Here is the documentation for rustdoc's main tests (the tests in src/test/rustdoc):

https://github.com/rust-lang/rust/blob/49d42325d0888a27ed50bf918d378fbf7f41a348/src/etc/htmldocck.py#L28-L100

You may also want to look at some existing tests in src/test/rustdoc.

Please note that you do not need to check that rustdoc's behavior is correct. We will check during code review, and as mentioned earlier, tests for incorrect behavior can be helpful too.

If you have any questions or get stuck, please ask here or on Zulip in #rustdoc!

camelid commented 2 years ago

cc @rust-lang/rustdoc

cameron1024 commented 2 years ago

@rustbot claim

jyn514 commented 2 years ago

@cameron1024 Since this is a tracking issue, I don't think it makes sense to claim - I plan to add some examples of tests soon, and it's definitely possible for multiple people to work on it in parallel :) feel free to work on it in the meantime though!

NoobProgrammer31 commented 1 month ago

@rustbot claim

ismailarilik commented 1 month ago

I think the description should be updated. Tests are in tests/rustdoc now, not in src/test/rustdoc; actually it is not exist anymore.

ismailarilik commented 1 month ago

I was thinking on this issue and just wonder if there is any coverage tool we can use to see the blind points; it might be helpful for this case.