fix(validation): restore isolated local checks

This commit is contained in:
2026-10-30 04:21:56 -03:00
parent e0f2026a2f
commit 8a560b8e6e
36 changed files with 586 additions and 227 deletions
+19
View File
@@ -35,3 +35,22 @@ teardown() {
run grep -c "KEY=new" "$CONFIG_FILE"
[ "$output" -eq 1 ]
}
@test "config preserves spaces and literal replacement characters" {
local value='/tmp/Unleash logs/quoted "name" & \tail'
save_config LOG_FILE old
save_config LOG_FILE "$value"
LOG_FILE=''
load_config
[ "$LOG_FILE" = "$value" ]
}
@test "config unset preserves other keys" {
save_config WEBHOOK 'https://example.com/a?x=1&y=2'
save_config LOG_LEVEL verbose
run cmd_config config unset LOG_LEVEL
[ "$status" -eq 0 ]
run grep -c '^LOG_LEVEL=' "$CONFIG_FILE"
[ "$status" -eq 1 ]
grep -q '^WEBHOOK=https://example.com/a?x=1&y=2$' "$CONFIG_FILE"
}