Single-commit clean baseline after security scrub of niche-tells, project codenames, internal jargon, and contributor-email leaks. Contents: - 100 Rust crates (_primitives/_rust/) - 37 agent manifests (_manifests/) + generated specs (_generated/) - 67 user-invocable skills (skills/) - 33 hooks (hooks/) - Composition blocks (_blocks/) - Documentation (docs/, README.md) - TS adapter packages (_ts_packages/) - Assembler (_assembler/) - Roles (_roles/) - Templates (_templates/) - Forgejo CI (.forgejo/) Author: Denis Parfionovich <info@greendragon.info> License: see LICENSE.
27 lines
814 B
Rust
27 lines
814 B
Rust
//! OS detection on macOS via sw_vers.
|
|
|
|
use kei_machine_probe::{detect_os, MockRunner, OsFamily};
|
|
|
|
#[test]
|
|
fn parses_sw_vers_to_macos_info() {
|
|
let runner = MockRunner::from_dir(".")
|
|
.with_ok("sw_vers_-productVersion", "14.5\n")
|
|
.with_ok("sw_vers_-buildVersion", "23F79\n");
|
|
|
|
let os = detect_os(&runner);
|
|
assert_eq!(os.family, OsFamily::Macos);
|
|
assert_eq!(os.version, "14.5");
|
|
assert_eq!(os.build, "23F79");
|
|
}
|
|
|
|
#[test]
|
|
fn missing_build_falls_through_but_keeps_version() {
|
|
let runner = MockRunner::from_dir(".")
|
|
.with_ok("sw_vers_-productVersion", "13.6.1\n")
|
|
.with_err("sw_vers_-buildVersion", "no build key");
|
|
|
|
let os = detect_os(&runner);
|
|
assert_eq!(os.family, OsFamily::Macos);
|
|
assert_eq!(os.version, "13.6.1");
|
|
assert_eq!(os.build, "");
|
|
}
|