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.
36 lines
1.2 KiB
Rust
36 lines
1.2 KiB
Rust
//! Arch detection on an Intel MacBook Pro fixture.
|
|
|
|
use kei_machine_probe::{detect_arch, CpuFamily, MockRunner};
|
|
|
|
#[test]
|
|
fn detects_intel_x86_64_when_arm64_flag_zero() {
|
|
let runner = MockRunner::from_dir(".")
|
|
.with_ok("sysctl_-n_hw.model", "MacBookPro16,4\n")
|
|
.with_ok(
|
|
"sysctl_-n_machdep.cpu.brand_string",
|
|
"Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz\n",
|
|
)
|
|
.with_ok("sysctl_-n_hw.optional.arm64", "0\n")
|
|
.with_ok("sysctl_-n_hw.ncpu", "16\n");
|
|
|
|
let arch = detect_arch(&runner);
|
|
assert_eq!(arch.family, CpuFamily::IntelX86_64);
|
|
assert_eq!(arch.model_id, "MacBookPro16,4");
|
|
assert_eq!(arch.cores, 16);
|
|
assert!(arch.brand.contains("Intel"));
|
|
}
|
|
|
|
#[test]
|
|
fn intel_brand_without_arm64_flag_still_classifies() {
|
|
let runner = MockRunner::from_dir(".")
|
|
.with_ok("sysctl_-n_hw.model", "iMac20,1\n")
|
|
.with_ok(
|
|
"sysctl_-n_machdep.cpu.brand_string",
|
|
"Intel(R) Core(TM) i7\n",
|
|
)
|
|
.with_err("sysctl_-n_hw.optional.arm64", "key not found")
|
|
.with_ok("sysctl_-n_hw.ncpu", "8\n");
|
|
|
|
let arch = detect_arch(&runner);
|
|
assert_eq!(arch.family, CpuFamily::IntelX86_64);
|
|
}
|