mirror of
https://gitlab.com/hyask/swaysome.git
synced 2025-12-10 07:44:43 +01:00
tests: add test_binary_version as a poor safeguard
This commit is contained in:
parent
3514b9cd5b
commit
2410c1164d
1 changed files with 17 additions and 0 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue