Skip to content

Commit 192b172

Browse files
GuillaumeGomezcarllerche
authored andcommitted
Automatically test code examples in the README file (#314)
1 parent cece1b8 commit 192b172

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
@@ -33,6 +33,7 @@ rand = "0.4"
3333
seahash = "3.0.5"
3434
serde = "1.0"
3535
serde_json = "1.0"
36+
doc-comment = "0.3"
3637

3738
[[bench]]
3839
name = "header_map"

src/lib.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,13 @@ extern crate bytes;
163163
extern crate fnv;
164164
extern crate itoa;
165165

166+
#[cfg(test)]
167+
#[macro_use]
168+
extern crate doc_comment;
169+
170+
#[cfg(test)]
171+
doctest!("../README.md");
172+
166173
pub mod header;
167174
pub mod method;
168175
pub mod request;

0 commit comments

Comments
 (0)