xref: /libCEED/rust/libceed-sys/tests/version-numbers.rs (revision 8a059566a00d2f44ccef3f872c398f1e412e74dd) !
1*8a059566SJed Brown use std::path::{Path, PathBuf};
2*8a059566SJed Brown 
3*8a059566SJed Brown fn get_rel_path(rel: impl AsRef<Path>) -> PathBuf {
4*8a059566SJed Brown     let path = std::env::current_dir().unwrap();
5*8a059566SJed Brown     if path.ends_with("rust/libceed-sys") {
6*8a059566SJed Brown         rel.as_ref().to_path_buf()
7*8a059566SJed Brown     } else {
8*8a059566SJed Brown         Path::new("rust/libceed-sys").join(rel)
9*8a059566SJed Brown     }
10*8a059566SJed Brown }
11*8a059566SJed Brown 
12*8a059566SJed Brown #[test]
13*8a059566SJed Brown fn test_doc_version() {
14*8a059566SJed Brown     version_sync::assert_contains_regex!(
15*8a059566SJed Brown         get_rel_path("src/lib.rs").to_str().unwrap(),
16*8a059566SJed Brown         "{name} = \"{version}\""
17*8a059566SJed Brown     );
18*8a059566SJed Brown }
19