From 192b172d4cbdb6492bf14efc3872b6f115c2b48e Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Mon, 15 Jul 2019 23:50:56 +0200 Subject: [PATCH] Automatically test code examples in the README file (#314) --- Cargo.toml | 1 + src/lib.rs | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 6ed49dd6..dd191626 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -33,6 +33,7 @@ rand = "0.4" seahash = "3.0.5" serde = "1.0" serde_json = "1.0" +doc-comment = "0.3" [[bench]] name = "header_map" diff --git a/src/lib.rs b/src/lib.rs index 80dd594f..1e0554dd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -163,6 +163,13 @@ extern crate bytes; extern crate fnv; extern crate itoa; +#[cfg(test)] +#[macro_use] +extern crate doc_comment; + +#[cfg(test)] +doctest!("../README.md"); + pub mod header; pub mod method; pub mod request;