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
All checks were successful
Golan Testing / testing (1.24.x, ubuntu-latest) (push) Successful in 26s
This commit is contained in:
@ -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)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user