strsim-rs icon indicating copy to clipboard operation
strsim-rs copied to clipboard

Add tests for README file

Open GuillaumeGomez opened this issue 5 years ago • 3 comments

It allows to test code examples in the README.md file.

GuillaumeGomez avatar May 20 '19 13:05 GuillaumeGomez

Hi, should the tests be showing up in the CI output? I don't see them.

dguo avatar Jul 23 '19 01:07 dguo

It only works on nightly for the moment. Also, I need to update this PR since it's not #[cfg(test)] anymore... I'll add a run for cargo test on your CI script as well.

GuillaumeGomez avatar Jul 23 '19 08:07 GuillaumeGomez

For the time being, you can run the readme doc tests by using the "readme" feature (if we're lucky, doctest should be stabilized pretty quickly...) by doing:

cargo test --features readme

And normally you should see with the tests output:

test <::doc_comment::doc_comment macros> -  (line 65) ... ok
test <::doc_comment::doc_comment macros> -  (line 31) ... ok

GuillaumeGomez avatar Jul 23 '19 08:07 GuillaumeGomez