xref: /libCEED/rust/libceed-sys/tests/version-numbers.rs (revision c4016ce5e01824a90bfdd2159ea8004eb7b29eef)
18a059566SJed Brown use std::path::{Path, PathBuf};
28a059566SJed Brown 
get_rel_path(rel: impl AsRef<Path>) -> PathBuf38a059566SJed Brown fn get_rel_path(rel: impl AsRef<Path>) -> PathBuf {
48a059566SJed Brown     let path = std::env::current_dir().unwrap();
58a059566SJed Brown     if path.ends_with("rust/libceed-sys") {
68a059566SJed Brown         rel.as_ref().to_path_buf()
78a059566SJed Brown     } else {
88a059566SJed Brown         Path::new("rust/libceed-sys").join(rel)
98a059566SJed Brown     }
108a059566SJed Brown }
118a059566SJed Brown 
128a059566SJed Brown #[test]
test_doc_version()138a059566SJed Brown fn test_doc_version() {
148a059566SJed Brown     version_sync::assert_contains_regex!(
15*09752d44SJed Brown         get_rel_path("README.md").to_str().unwrap(),
168a059566SJed Brown         "{name} = \"{version}\""
178a059566SJed Brown     );
188a059566SJed Brown }
19