diff options
author | ClementTsang <cjhtsang@uwaterloo.ca> | 2022-05-01 17:15:54 -0400 |
---|---|---|
committer | ClementTsang <cjhtsang@uwaterloo.ca> | 2022-05-01 17:15:54 -0400 |
commit | 798683b81f476087e12c7a1fbeb5146a57b7bc76 (patch) | |
tree | 93c04366e2f1047fc7ec9a676ea31c4b5fe48490 /tests | |
parent | c44e860af86b68feae6fcf14cc63ef74ef4c8570 (diff) |
other: add test for battery flag if battery feature is off
Diffstat (limited to 'tests')
-rw-r--r-- | tests/arg_tests.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/arg_tests.rs b/tests/arg_tests.rs index 649b1cfb..95afb635 100644 --- a/tests/arg_tests.rs +++ b/tests/arg_tests.rs @@ -168,3 +168,16 @@ fn test_missing_default_widget_type() { "The following required arguments were not provided", )); } + +#[test] +fn test_battery_flag() { + if !cfg!(feature = "battery") { + Command::new(get_binary_location()) + .arg("--battery") + .assert() + .failure() + .stderr(predicate::str::contains( + "'--battery' which wasn't expected", + )); + } +} |