From 68df041a09a852ff7cf5e348135f9f063e4e91eb Mon Sep 17 00:00:00 2001 From: Greg Gauthier Date: Mon, 2 Mar 2026 18:41:14 +0000 Subject: [PATCH] test(version): add tests for version information Add unit tests to verify that Version is set and note that Commit and BuildDate may be empty in development builds. Update .gitignore to ignore the .junie/ directory. --- .gitignore | 1 + internal/version/version_test.go | 39 ++++++++++++++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 internal/version/version_test.go diff --git a/.gitignore b/.gitignore index 933b0bc..705bd50 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ .idea/ +.junie/ build/ grokkit *.bak diff --git a/internal/version/version_test.go b/internal/version/version_test.go new file mode 100644 index 0000000..804d997 --- /dev/null +++ b/internal/version/version_test.go @@ -0,0 +1,39 @@ +package version + +import "testing" + +func TestVersionInfo(t *testing.T) { + t.Parallel() + + tests := []struct { + name string + check func(*testing.T) + }{ + { + name: "Version", + check: func(t *testing.T) { + if Version == "" { + t.Error("Version should be set") + } + }, + }, + { + name: "Commit", + check: func(t *testing.T) { + // Commit can be empty in dev builds + }, + }, + { + name: "BuildDate", + check: func(t *testing.T) { + // BuildDate can be empty in dev builds + }, + }, + } + + for _, tt := range tests { + t.Run(tt.name, func(t *testing.T) { + tt.check(t) + }) + } +}