Skip to content

Commit

Permalink
Automatically check if README.md examples are working when running "c…
Browse files Browse the repository at this point in the history
…argo test"
  • Loading branch information
GuillaumeGomez committed Apr 28, 2019
1 parent 88994b2 commit e519fd4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ optional = true
[features]
spin_no_std = ["spin"]

[dev-dependencies]
doc-comment = "0.3.1"

[badges]
appveyor = { repository = "rust-lang-nursery/lazy-static.rs" }
travis-ci = { repository = "rust-lang-nursery/lazy-static.rs" }
Expand Down
7 changes: 7 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,13 @@ This crate provides one cargo feature:
#[doc(hidden)]
pub mod lazy;

#[cfg(test)]
#[macro_use]
extern crate doc_comment;

#[cfg(test)]
doctest!("../README.md");

#[cfg(feature = "spin_no_std")]
#[path="core_lazy.rs"]
#[doc(hidden)]
Expand Down

0 comments on commit e519fd4

Please sign in to comment.