KeiSeiKit-1.0/_primitives/_rust/kei-machine-probe/tests/tooling_ollama_present.rs
Parfii-bot 0be354a920 KeiSeiKit-public — clean state
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.
2026-05-01 12:09:03 +08:00

35 lines
1.2 KiB
Rust

//! Tooling detection — ollama present, brew present, llama-server absent.
use kei_machine_probe::{detect_tooling, MockRunner};
#[test]
fn parses_versions_when_binaries_present() {
let runner = MockRunner::from_dir(".")
.with_ok("which_ollama", "/opt/homebrew/bin/ollama\n")
.with_ok("ollama_--version", "ollama version is 0.3.12\n")
.with_ok("which_brew", "/opt/homebrew/bin/brew\n")
.with_ok("brew_--version", "Homebrew 4.3.20\n")
.with_err("which_llama-server", "exit 1");
let t = detect_tooling(&runner);
assert_eq!(t.ollama.as_deref(), Some("0.3.12"));
assert_eq!(t.homebrew.as_deref(), Some("4.3.20"));
assert!(t.llama_cpp.is_none());
}
#[test]
fn parses_llama_server_version_too() {
let runner = MockRunner::from_dir(".")
.with_err("which_ollama", "no")
.with_err("which_brew", "no")
.with_ok("which_llama-server", "/usr/local/bin/llama-server\n")
.with_ok(
"llama-server_--version",
"version: 4297 (b46d12f0)\nbuilt with Apple clang version 16.0.0\n",
);
let t = detect_tooling(&runner);
assert!(t.ollama.is_none());
assert!(t.homebrew.is_none());
assert_eq!(t.llama_cpp.as_deref(), Some("4297"));
}