mirror of
https://github.com/tw93/Mole.git
synced 2026-03-23 21:35:06 +00:00
fix(clean): align threshold colors with displayed GB units
This commit is contained in:
@@ -44,13 +44,16 @@ setup() {
|
||||
[[ -n "$result" ]]
|
||||
}
|
||||
|
||||
@test "cleanup_result_color_kb switches from yellow to green at 1 GiB" {
|
||||
@test "cleanup_result_color_kb switches from yellow to green at 1 GB" {
|
||||
run env HOME="$HOME" PROJECT_ROOT="$PROJECT_ROOT" bash --noprofile --norc <<'EOF'
|
||||
set -euo pipefail
|
||||
source "$PROJECT_ROOT/lib/core/common.sh"
|
||||
|
||||
if [[ "$(cleanup_result_color_kb $((MOLE_ONE_GIB_KB - 1)))" == "$YELLOW" ]] &&
|
||||
[[ "$(cleanup_result_color_kb "$MOLE_ONE_GIB_KB")" == "$GREEN" ]]; then
|
||||
below_threshold_kb=$(((MOLE_ONE_GB_BYTES - 1) / 1024))
|
||||
at_threshold_kb=$(((MOLE_ONE_GB_BYTES + 1023) / 1024))
|
||||
|
||||
if [[ "$(cleanup_result_color_kb "$below_threshold_kb")" == "$YELLOW" ]] &&
|
||||
[[ "$(cleanup_result_color_kb "$at_threshold_kb")" == "$GREEN" ]]; then
|
||||
echo "ok"
|
||||
fi
|
||||
EOF
|
||||
|
||||
Reference in New Issue
Block a user