From 789ede9ef3d6ea906334381760f4b561e57cb1ed Mon Sep 17 00:00:00 2001 From: John D Pell Date: Sun, 20 Feb 2022 13:26:55 -0800 Subject: [PATCH] plugin/battery: fix tests --- test/plugins/battery.plugin.bats | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/plugins/battery.plugin.bats b/test/plugins/battery.plugin.bats index f06fa008..51ef93e9 100755 --- a/test/plugins/battery.plugin.bats +++ b/test/plugins/battery.plugin.bats @@ -196,12 +196,11 @@ function setup_upower { percent="$1" BAT0="/org/freedesktop/UPower/devices/battery_BAT$RANDOM" - function upower { case $1 in '-e'|'--enumerate') - echo "$BAT0" - echo "/org/freedesktop/UPower/devices/mouse_hid_${RANDOM}_battery" + # don't just `echo` twice because `grep` will close the pipe after matching the first line... + echo "$BAT0"$'\n'"/org/freedesktop/UPower/devices/mouse_hid_${RANDOM}_battery" ;; '-i'|'--show-info') if [[ $2 == "$BAT0" ]]