Public source validation / validate (push) Failing after 3m8s
26 lines
560 B
Go
26 lines
560 B
Go
package buildinfo
|
|
|
|
import (
|
|
"testing"
|
|
"time"
|
|
)
|
|
|
|
func TestVersionIsNonEmpty(t *testing.T) {
|
|
if Version == "" {
|
|
t.Fatal("version must not be empty")
|
|
}
|
|
}
|
|
|
|
func TestBuiltAtRejectsPlaceholderAndNormalizesUTC(t *testing.T) {
|
|
original := BuildTime
|
|
t.Cleanup(func() { BuildTime = original })
|
|
BuildTime = "unknown"
|
|
if BuiltAt() != nil {
|
|
t.Fatal("placeholder build time must be absent")
|
|
}
|
|
BuildTime = "2026-08-12T04:00:00+02:00"
|
|
if got := BuiltAt(); got == nil || got.Format(time.RFC3339) != "2026-08-12T02:00:00Z" {
|
|
t.Fatalf("built at = %v", got)
|
|
}
|
|
}
|