10000 tests: ensure version numbers in README are always up to date · unicode-rs/unicode-segmentation@827ed2e · GitHub
[go: up one dir, main page]

Skip to content

Commit 827ed2e

Browse files
committed
tests: ensure version numbers in README are always up to date
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 #30, #41, #47, and #48.
1 parent fc5d1d5 commit 827ed2e

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ no_std = [] # This is a no-op, preserved for backward compatibility only.
2323

2424
[dev-dependencies]
2525
quickcheck = "0.7"
26+
version-sync = "0.8"

tests/version-numbers.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#[test]
2+
fn test_readme_deps() {
3+
version_sync::assert_markdown_deps_updated!("README.md");
4+
}
5+
6+
#[test]
7+
fn test_readme_changelog() {
8+
version_sync::assert_contains_regex!("README.md", r"^## {version}$");
9+
}
10+
11+
#[test]
12+
fn test_html_root_url() {
13+
version_sync::assert_html_root_url_updated!("src/lib.rs");
14+
}

0 commit comments

Comments
 (0)
0