Skip to content

Commit

Permalink
tests: ensure version numbers in README are always up to date
Browse files Browse the repository at this point in the history
This adds a test that will check the examples in README.md for the
current package version.

It also checks that there is a Markdown heading mentioning (at least)
the current version. This serves as a simple check that the change log
section is updated when the version number is bumped.

Related to unicode-rs#30, unicode-rs#41, unicode-rs#47, and unicode-rs#48.
  • Loading branch information
mgeisler committed Mar 30, 2019
1 parent fc5d1d5 commit 827ed2e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
1 change: 1 addition & 0 deletions Cargo.toml
Expand Up @@ -23,3 +23,4 @@ no_std = [] # This is a no-op, preserved for backward compatibility only.

[dev-dependencies]
quickcheck = "0.7"
version-sync = "0.8"
14 changes: 14 additions & 0 deletions tests/version-numbers.rs
@@ -0,0 +1,14 @@
#[test]
fn test_readme_deps() {
version_sync::assert_markdown_deps_updated!("README.md");
}

#[test]
fn test_readme_changelog() {
version_sync::assert_contains_regex!("README.md", r"^## {version}$");
}

#[test]
fn test_html_root_url() {
version_sync::assert_html_root_url_updated!("src/lib.rs");
}

0 comments on commit 827ed2e

Please sign in to comment.