Refactor code structure and remove redundant sections for improved readability and maintainability
All checks were successful
Golan Testing / testing (1.24.x, ubuntu-latest) (push) Successful in 26s

This commit is contained in:
2025-07-06 14:23:35 -04:00
parent b61b5664b7
commit 152eb2c7b7
9 changed files with 813 additions and 156 deletions

View File

@ -22,6 +22,17 @@ func TestTimestamp(t *testing.T) {
}
}
func TestTimestamp_Format(t *testing.T) {
ts := timestamp()
matched, err := regexp.MatchString(`^\d+$`, ts)
if err != nil {
t.Fatalf("regexp error: %v", err)
}
if !matched {
t.Errorf("timestamp() = %q, want only digits", ts)
}
}
func TestUrlToGen(t *testing.T) {
tests := []struct {
url, gen, want string
@ -108,14 +119,3 @@ func TestUrlToGen_NoApiGen(t *testing.T) {
t.Errorf("urlToGen(%q, %q) = %q, want %q", url, gen, got, url)
}
}
func TestTimestamp_Format(t *testing.T) {
ts := timestamp()
matched, err := regexp.MatchString(`^\d+$`, ts)
if err != nil {
t.Fatalf("regexp error: %v", err)
}
if !matched {
t.Errorf("timestamp() = %q, want only digits", ts)
}
}