Skip to content

Commit fd84409

Browse files
GuillaumeGomezseanmonstar
authored andcommitted
Automatically test code examples in the README file (#314)
1 parent 8a3361f commit fd84409

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ rand = "0.7.0"
3737
seahash = "3.0.5"
3838
serde = "1.0"
3939
serde_json = "1.0"
40+
doc-comment = "0.3"
4041

4142
[[bench]]
4243
name = "header_map"

src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,13 @@
160160
161161
#![deny(warnings, missing_docs, missing_debug_implementations)]
162162

163+
#[cfg(test)]
164+
#[macro_use]
165+
extern crate doc_comment;
166+
167+
#[cfg(test)]
168+
doctest!("../README.md");
169+
163170
pub mod header;
164171
pub mod method;
165172
pub mod request;

0 commit comments

Comments
 (0)