mirror of
https://github.com/PrivateCaptcha/PrivateCaptcha.git
synced 2026-04-29 09:19:36 -05:00
0f70c38529
80% done by Claude Opus 4.5 w/ copilot, but not quite
29 lines
572 B
Go
29 lines
572 B
Go
package common
|
|
|
|
import "testing"
|
|
|
|
func TestTimePeriodString(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
tests := []struct {
|
|
period TimePeriod
|
|
expected string
|
|
}{
|
|
{TimePeriodToday, "today"},
|
|
{TimePeriodWeek, "week"},
|
|
{TimePeriodMonth, "month"},
|
|
{TimePeriodYear, "year"},
|
|
{TimePeriod(100), "unknown"},
|
|
{TimePeriod(-1), "unknown"},
|
|
}
|
|
|
|
for _, tt := range tests {
|
|
t.Run(tt.expected, func(t *testing.T) {
|
|
result := tt.period.String()
|
|
if result != tt.expected {
|
|
t.Errorf("TimePeriod(%d).String() = %q, want %q", tt.period, result, tt.expected)
|
|
}
|
|
})
|
|
}
|
|
}
|