package handlers_test import ( "testing" "git.eeqj.de/sneak/upaas/internal/handlers" ) func TestSanitizeTail(t *testing.T) { t.Parallel() tests := []struct { name string input string expected string }{ {"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.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"}, } for _, tc := range tests { t.Run(tc.name, func(t *testing.T) { t.Parallel() got := handlers.SanitizeTail(tc.input) if got != tc.expected { t.Errorf("sanitizeTail(%q) = %q, want %q", tc.input, got, tc.expected) } }) } }