Files
komorebi/komorebi-daemon/tests/linux_version.rs
T
LGUG2Z cce2886622 refactor(version): one komorebi-version crate for Linux and macOS
version-linux (komorebi-for-kde/version, shadow-rs 2) and version-macos
(komorebi-for-mac/version, shadow-rs 1) had the same build.rs and the same lib.rs. They
are now one package, crates/komorebi-version (lib name version, shadow-rs from the
workspace), and the KDE and macOS daemons, their command lines and the unified komorebic
depend on it under the key version. The extern crate lines of komorebic/src/main.rs that
renamed the two crates are gone, and the two deny.toml clarify entries name the new
package.

komorebi-daemon/tests/linux_version.rs read the version out of the old crate's Cargo.toml
text, which no longer has a number (it is inherited); it now expects the package version,
which is the workspace version.

Verified: cargo test -p komorebi -p komorebic -p komorebi-client -p komorebi-linux (KDE
side, native Linux) all pass, including the version test; cargo check --target
aarch64-apple-darwin of the macOS packages with the fake C compiler passes. Windows and
nix were not run for this revision (Windows does not use the crate; nix runs at the end of
the stack).
2026-11-05 15:03:27 -08:00

22 lines
686 B
Rust

#![cfg(target_os = "linux")]
//! `komorebi --version` reports the workspace version.
use std::process::Command;
#[test]
fn reports_the_package_version() {
let output = Command::new(env!("CARGO_BIN_EXE_komorebi"))
.arg("--version")
.output()
.expect("komorebi runs");
assert!(output.status.success());
let stdout = String::from_utf8(output.stdout).expect("utf-8 output");
// every package of the workspace has the workspace version, so this package's is the one the
// `komorebi-version` crate reports
let expected = format!("komorebi {}", env!("CARGO_PKG_VERSION"));
assert_eq!(stdout.lines().next(), Some(expected.as_str()));
}