diff --git a/tests/integration_bin.rs b/tests/integration_bin.rs index 6da8b30..6d8fd61 100644 --- a/tests/integration_bin.rs +++ b/tests/integration_bin.rs @@ -5,6 +5,23 @@ use utils::Sway; static SWAYSOME_BIN: &str = env!("CARGO_BIN_EXE_swaysome"); +// Poor safeguard that the tests are actually testing the right version, in +// case there is some confusion with a swaysome installed from the system. That +// obviously does not always worked, but has saved me a couple of times already 🙃 +#[test] +fn test_binary_version() { + let output = Command::new(SWAYSOME_BIN) + .args(["--version"]) + .env_clear() + .env("SWAYSOCK", "/dev/null") + .output() + .expect("Couldn't run swaysome"); + assert_eq!( + String::from_utf8(output.stdout).unwrap(), + format!("swaysome {}\n", env!("CARGO_PKG_VERSION")) + ); +} + // This is useful when working on swapping argument parsing libraries. #[test] fn test_binary_help() {