Allow value prefixed with bang to skip parsing

This commit is contained in:
Dan Jones 2024-10-31 14:31:16 -05:00
commit a8cbfd087f
2 changed files with 8 additions and 0 deletions

View file

@ -38,6 +38,10 @@ func TestParse(t *testing.T) {
{"on-value", "on", true},
{"no-value", "no", false},
{"off-value", "off", false},
{"skip-parsing-num", "!42", "42"},
{"skip-parsing-bool", "!false", "false"},
{"skip-parsing-time", "!" + when.Format(time.RFC3339), when.Format(time.RFC3339)},
{"skip-parsing-duration", "!15 mins", "15 mins"},
}
for _, tt := range tests {