diff options
| author | Fuwn <[email protected]> | 2026-02-26 15:07:03 -0800 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2026-02-26 15:07:03 -0800 |
| commit | f1b26a68534e4299de7b5fe6b15d2b248fac40e1 (patch) | |
| tree | 4003d041bc46866b7d4b7f0bfb6c6924d991cbb6 /cmd/plutia/version_test.go | |
| parent | feat: initial Plutia release — verifiable high-performance PLC mirror (mirr... (diff) | |
| download | plutia-test-f1b26a68534e4299de7b5fe6b15d2b248fac40e1.tar.xz plutia-test-f1b26a68534e4299de7b5fe6b15d2b248fac40e1.zip | |
feat: harden launch readiness with versioning, metrics, and resilience
Diffstat (limited to 'cmd/plutia/version_test.go')
| -rw-r--r-- | cmd/plutia/version_test.go | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/cmd/plutia/version_test.go b/cmd/plutia/version_test.go new file mode 100644 index 0000000..3869de6 --- /dev/null +++ b/cmd/plutia/version_test.go @@ -0,0 +1,31 @@ +package main + +import ( + "strings" + "testing" +) + +func TestFormatVersionIncludesBuildMetadata(t *testing.T) { + oldVersion, oldCommit, oldBuildDate := version, commit, buildDate + version = "v0.1.0" + commit = "abc123" + buildDate = "2026-02-26T00:00:00Z" + t.Cleanup(func() { + version = oldVersion + commit = oldCommit + buildDate = oldBuildDate + }) + + out := formatVersion() + checks := []string{ + "Version: v0.1.0", + "Commit: abc123", + "BuildDate: 2026-02-26T00:00:00Z", + "GoVersion: go", + } + for _, want := range checks { + if !strings.Contains(out, want) { + t.Fatalf("version output missing %q: %s", want, out) + } + } +} |