Skip to content

Commit

Permalink
Remove readme_references_current_version test
Browse files Browse the repository at this point in the history
  • Loading branch information
smoelius committed Jan 21, 2024
1 parent 2b2015a commit f74a804
Showing 1 changed file with 0 additions and 28 deletions.
28 changes: 0 additions & 28 deletions test-fuzz/tests/versions.rs
Original file line number Diff line number Diff line change
@@ -1,18 +1,9 @@
use cargo_metadata::{Dependency, DependencyKind, Metadata, MetadataCommand};
use once_cell::sync::Lazy;
use regex::{Match, Regex};
use semver::Version;
use std::{
fs::read_to_string,
path::{Path, PathBuf},
};

static METADATA: Lazy<Metadata> = Lazy::new(|| MetadataCommand::new().no_deps().exec().unwrap());

#[allow(unknown_lints, env_cargo_path)]
static README_PATH: Lazy<PathBuf> =
Lazy::new(|| Path::new(env!("CARGO_MANIFEST_DIR")).join("../README.md"));

#[test]
fn versions_are_equal() {
for package in &METADATA.packages {
Expand Down Expand Up @@ -70,22 +61,3 @@ fn afl_version_is_exact() {
}
}
}

#[test]
fn readme_references_current_version() {
let re = Regex::new(r#"(test-fuzz|version) = "([^"]*)""#).unwrap();
let content = read_to_string(&*README_PATH).unwrap();
for group in re.captures_iter(&content) {
let matches: Vec<Option<&str>> = group
.iter()
.map(|match_| match_.as_ref().map(Match::as_str))
.collect();
let version = Version::parse(env!("CARGO_PKG_VERSION")).unwrap();
assert_eq!(
matches.last(),
Some(&Some(
format!("{}.{}", version.major, version.minor).as_str()
))
);
}
}

0 comments on commit f74a804

Please sign in to comment.