Files
ITWorx-Pulse-Public/internal/buildinfo/buildinfo_test.go
T
ITWorx Pulse release export bd774932d5
Public source validation / validate (push) Failing after 3m8s
Publish ITWorx Pulse source
2026-09-03 02:09:19 +02:00

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)
}
}