refactor: export SanitizeTail and DefaultLogTail directly instead of wrapping

- Rename sanitizeTail → SanitizeTail (exported)
- Rename defaultLogTail → DefaultLogTail (exported)
- Delete export_test.go (no longer needed)
- Update test to reference handlers.SanitizeTail/DefaultLogTail directly
This commit is contained in:
user
2026-02-15 22:14:12 -08:00
parent 69a5a8c298
commit a80b7ac0a6
3 changed files with 14 additions and 23 deletions

View File

@@ -14,16 +14,16 @@ func TestSanitizeTail(t *testing.T) {
input string
expected string
}{
{"empty uses default", "", handlers.ExportedDefaultLogTail},
{"empty uses default", "", handlers.DefaultLogTail},
{"valid small number", "50", "50"},
{"valid max boundary", "500", "500"},
{"exceeds max clamped", "501", "500"},
{"very large clamped", "999999", "500"},
{"non-numeric uses default", "abc", handlers.ExportedDefaultLogTail},
{"all keyword uses default", "all", handlers.ExportedDefaultLogTail},
{"negative uses default", "-1", handlers.ExportedDefaultLogTail},
{"zero uses default", "0", handlers.ExportedDefaultLogTail},
{"float uses default", "1.5", handlers.ExportedDefaultLogTail},
{"non-numeric uses default", "abc", handlers.DefaultLogTail},
{"all keyword uses default", "all", handlers.DefaultLogTail},
{"negative uses default", "-1", handlers.DefaultLogTail},
{"zero uses default", "0", handlers.DefaultLogTail},
{"float uses default", "1.5", handlers.DefaultLogTail},
{"one is valid", "1", "1"},
}
@@ -31,7 +31,7 @@ func TestSanitizeTail(t *testing.T) {
t.Run(tc.name, func(t *testing.T) {
t.Parallel()
got := handlers.ExportedSanitizeTail(tc.input)
got := handlers.SanitizeTail(tc.input)
if got != tc.expected {
t.Errorf("sanitizeTail(%q) = %q, want %q", tc.input, got, tc.expected)
}