MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / TestGetBuildDate

Function TestGetBuildDate

internal/version/version_test.go:59–86  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

57}
58
59func TestGetBuildDate(t *testing.T) {
60 info := GetBuildInfo()
61
62 if info.BuildDate == unknownBuildValue {
63 // If build date is unknown, the function should return an error
64 _, err := GetBuildDate()
65 if err == nil {
66 t.Error("GetBuildDate() should return error when build date is unknown")
67 }
68 return
69 }
70
71 // If build date is set, it should parse correctly
72 buildTime, err := GetBuildDate()
73 if err != nil {
74 t.Errorf("GetBuildDate() failed to parse build date: %v", err)
75 }
76
77 // Build time should be reasonable (not zero time)
78 if buildTime.IsZero() {
79 t.Error("GetBuildDate() returned zero time")
80 }
81
82 // Build time should be in the past
83 if buildTime.After(time.Now()) {
84 t.Error("GetBuildDate() returned future time")
85 }
86}
87
88func TestIsDevBuild(t *testing.T) {
89 isDev := IsDevBuild()

Callers

nothing calls this directly

Calls 4

GetBuildInfoFunction · 0.85
GetBuildDateFunction · 0.85
IsZeroMethod · 0.80
ErrorMethod · 0.65

Tested by

no test coverage detected