Added test for the "no" energy tool case
parent
5ab0cc5388
commit
31990490fa
|
|
@ -74,7 +74,11 @@ battery_percentage(){
|
||||||
COMMAND_OUTPUT="no"
|
COMMAND_OUTPUT="no"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "${COMMAND_OUTPUT}" != "no" ]; then
|
||||||
printf "%02d" "${COMMAND_OUTPUT:--1}"
|
printf "%02d" "${COMMAND_OUTPUT:--1}"
|
||||||
|
else
|
||||||
|
echo "${COMMAND_OUTPUT}"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
battery_charge(){
|
battery_charge(){
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,18 @@ function setup_command_exists {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#######################
|
||||||
|
#
|
||||||
|
# no tool
|
||||||
|
#
|
||||||
|
|
||||||
|
@test 'plugins battery: battery-percentage with no tool' {
|
||||||
|
setup_command_exists "fooooo"
|
||||||
|
|
||||||
|
run battery_percentage
|
||||||
|
assert_output "no"
|
||||||
|
}
|
||||||
|
|
||||||
#######################
|
#######################
|
||||||
#
|
#
|
||||||
# pmset
|
# pmset
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue