From 3e2f6df04f9ef55654561506e0ba7f0158d74525 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Thu, 2 May 2019 17:28:28 +0200 Subject: [PATCH] Add doc-comment to test README examples --- Cargo.toml | 1 + src/lib.rs | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/Cargo.toml b/Cargo.toml index 05f59bc..176e306 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,3 +14,4 @@ categories = ["filesystem"] [dev-dependencies] tempdir = "0.3" +doc-comment = "0.3" diff --git a/src/lib.rs b/src/lib.rs index b28db9b..d9f2762 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -63,6 +63,13 @@ #![deny(missing_docs)] #![cfg_attr(all(test, windows), feature(std_misc))] +#[cfg(test)] +#[macro_use] +extern crate doc_comment; + +#[cfg(test)] +doctest!("../README.md"); + use std::cmp; use std::error::Error; use std::fmt;