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