xref: /libCEED/rust/libceed/tests/version-numbers.rs (revision 20a16a5fde8c37c2820b3798c7dd8f97d46128bb)
1 // Copyright (c) 2017-2025, Lawrence Livermore National Security, LLC and other CEED contributors
2 // All Rights Reserved. See the top-level COPYRIGHT and NOTICE files for details.
3 //
4 // SPDX-License-Identifier: (BSD-2-Clause)
5 //
6 // This file is part of CEED:  http://github.com/ceed
7 
8 use std::path::{Path, PathBuf};
9 
10 #[test]
11 fn test_readme_deps() {
12     let path = std::env::current_dir().unwrap();
13     version_sync::assert_markdown_deps_updated!(if path.ends_with("rust/libceed") {
14         "../../README.md"
15     } else {
16         "README.md"
17     });
18 }
19 
20 fn get_rel_path(rel: impl AsRef<Path>) -> PathBuf {
21     let path = std::env::current_dir().unwrap();
22     if path.ends_with("rust/libceed") {
23         rel.as_ref().to_path_buf()
24     } else {
25         Path::new("rust/libceed").join(rel)
26     }
27 }
28 
29 #[test]
30 fn test_html_root_url() {
31     version_sync::assert_html_root_url_updated!(get_rel_path("src/lib.rs").to_str().unwrap());
32 }
33 
34 #[test]
35 fn test_doc_version() {
36     version_sync::assert_contains_regex!(
37         get_rel_path("README.md").to_str().unwrap(),
38         "{name} = \"{version}\""
39     );
40 }
41