1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
//! Glossary coverage integration tests.
//!
//! These tests keep professional terms in a standalone glossary file.
use std::fs;
use std::path::{Path, PathBuf};
/// Returns the workspace root that owns project specifications.
///
/// # Arguments
///
/// This function has no arguments.
///
/// # Returns
///
/// Returns the parent directory of the package manifest directory.
fn workspace_root() -> PathBuf {
// Specs live at the workspace root after the workspace split.
Path::new(env!("CARGO_MANIFEST_DIR"))
.parent()
.expect("workspace root")
.to_path_buf()
}
/// Verifies that key public API terms are listed in the glossary.
#[test]
fn glossary_contains_public_api_terms() {
let glossary =
fs::read_to_string(workspace_root().join("specs/001-create-supervisor-core/glossary.md"))
.expect("read glossary");
for term in [
"`Supervisor`",
"`ChildSpec`",
"`SupervisorSpec`",
"`TaskFactory`",
"`SupervisorState`",
"`ChildState`",
"`ConfigState`",
"`SBOMArtifact`",
] {
assert!(glossary.contains(term), "missing glossary term {term}");
}
}
/// Verifies that the planned glossary gate checks professional and backtick terms.
#[test]
fn glossary_covers_professional_and_backtick_terms() {
glossary_contains_public_api_terms();
}