tests/the_console_product_is_holger_ui.rs
//! **The web console is the product `holger-ui`** (lane HOL-PRODUCTS, owner 2026-10-30):
//! `cargo install holger-ui` is the console, one of Holger's four products (`holger`,
//! `holger-downstream`, `holger-ui`, `holger-cli`).
//!
//! * `crates/holger-ui` is a thin crate: its one bin `holger-ui` over the library
//! `holger-ui-server` (the bundle host and the same-origin pass-through, which holger's
//! estate front links too). No copied code: the library has no bin of its own.
//! * It carries the console bundle in the binary when one was built (`cargo xtask console`).
//! * Its extras are the four every product names (`all-formats`, `online`, `federation`,
//! `full`); a console has no format and dials only its holger, so they add nothing.
//! * Both crates are publish-ready (the owner publishes).
use std::path::Path;
fn manifest(dir: &str) -> String {
let p = Path::new(env!("CARGO_MANIFEST_DIR")).join(dir).join("Cargo.toml");
std::fs::read_to_string(&p).unwrap_or_else(|e| panic!("read {}: {e}", p.display()))
}
#[test]
fn the_product_crate_is_holger_ui_with_one_bin() {
let m = manifest("crates/holger-ui");
assert!(m.contains("name = \"holger-ui\"\n"), "crates/holger-ui is the crate `holger-ui`:\n{m}");
assert_eq!(m.matches("[[bin]]").count(), 1, "one program:\n{m}");
assert!(m.contains("[[bin]]\nname = \"holger-ui\""), "the program is `holger-ui`:\n{m}");
assert!(m.contains("holger-ui-server = {"), "a thin crate over the library:\n{m}");
assert!(!m.contains("publish = false"), "publish-ready");
for extra in ["all-formats", "online", "federation", "full"] {
assert!(m.lines().any(|l| l.starts_with(&format!("{extra} = "))), "no `{extra}` feature:\n{m}");
}
}
#[test]
fn the_library_has_no_program_of_its_own() {
let m = manifest("crates/holger-ui-server");
assert!(!m.contains("[[bin]]"), "the program is holger-ui's");
assert!(!Path::new(env!("CARGO_MANIFEST_DIR")).join("crates/holger-ui-server/src/main.rs").exists(), "no second main");
assert!(!m.contains("publish = false"), "holger-ui depends on it, so it is published too");
}
#[test]
fn the_root_workspace_has_the_product() {
let m = manifest(".");
assert!(m.contains("\"crates/holger-ui\","), "crates/holger-ui is a member");
}