Skip to content

Commit

Permalink
Add tests for README file
Browse files Browse the repository at this point in the history
  • Loading branch information
GuillaumeGomez committed Jul 23, 2019
1 parent cc25041 commit 5d87674
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,9 @@ exclude = ["/.travis.yml", "/dev"]

[badges]
travis-ci = { repository = "dguo/strsim-rs" }

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

[features]
readme = [] # to be used to test readme examples as long as cfg(doctest) is unstable
11 changes: 11 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
//! This library implements string similarity metrics.
#![cfg_attr(feature = "readme", feature(cfg_doctest))]

#[cfg(feature = "readme")]
#[cfg(doctest)]
#[macro_use]
extern crate doc_comment;

#[cfg(feature = "readme")]
#[cfg(doctest)]
doctest!("../README.md");

use std::char;
use std::cmp::{max, min};
use std::collections::HashMap;
Expand Down

0 comments on commit 5d87674

Please sign in to comment.