Compare commits
1
Commits
0d6df8c2a2
...
6da4315f57
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6da4315f57 |
No files matched your search
@@ -37,13 +37,13 @@ func writeVersion(out *ui.Writer) {
|
||||
w := out.Out()
|
||||
|
||||
_, _ = fmt.Fprintf(w, "vaultik %s\n", globals.Version)
|
||||
_, _ = fmt.Fprintf(w, " commit: %s\n", globals.Commit)
|
||||
_, _ = fmt.Fprintf(w, " build date: %s\n", globals.CommitDate)
|
||||
_, _ = fmt.Fprintf(w, " go: %s\n", runtime.Version())
|
||||
_, _ = fmt.Fprintf(w, " os/arch: %s/%s\n", runtime.GOOS, runtime.GOARCH)
|
||||
_, _ = fmt.Fprintf(w, " author: %s\n", globals.Author)
|
||||
_, _ = fmt.Fprintf(w, " homepage: %s\n", globals.Homepage)
|
||||
_, _ = fmt.Fprintf(w, " license: %s\n", globals.License)
|
||||
_, _ = fmt.Fprintf(w, " commit: %s\n", globals.Commit)
|
||||
_, _ = fmt.Fprintf(w, " commit date: %s\n", globals.CommitDate)
|
||||
_, _ = fmt.Fprintf(w, " go: %s\n", runtime.Version())
|
||||
_, _ = fmt.Fprintf(w, " os/arch: %s/%s\n", runtime.GOOS, runtime.GOARCH)
|
||||
_, _ = fmt.Fprintf(w, " author: %s\n", globals.Author)
|
||||
_, _ = fmt.Fprintf(w, " homepage: %s\n", globals.Homepage)
|
||||
_, _ = fmt.Fprintf(w, " license: %s\n", globals.License)
|
||||
|
||||
if globals.IsDevVersion(globals.Version) {
|
||||
_, _ = fmt.Fprintln(w)
|
||||
|
||||
@@ -49,6 +49,25 @@ func TestVersionCommandReportsBuildVersion(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
// TestVersionCommandLabelsCommitDate checks that the date line is
|
||||
// labelled as the commit's date, which is what the build stamps into
|
||||
// it, and that its value starts in the same column as the commit's.
|
||||
//
|
||||
//nolint:paralleltest // executes a command that reads the global rootFlags
|
||||
func TestVersionCommandLabelsCommitDate(t *testing.T) {
|
||||
out := runVersionCommand(t)
|
||||
|
||||
wantLine := " commit date: " + globals.CommitDate
|
||||
if !strings.Contains(out, wantLine+"\n") {
|
||||
t.Errorf("output has no line %q:\n%s", wantLine, out)
|
||||
}
|
||||
|
||||
wantCommit := " commit: " + globals.Commit
|
||||
if !strings.Contains(out, wantCommit+"\n") {
|
||||
t.Errorf("output has no line %q:\n%s", wantCommit, out)
|
||||
}
|
||||
}
|
||||
|
||||
// TestVersionCommandFlagsDevelopmentBuild is the regression test for
|
||||
// the thing this command exists to prevent: a build that is not a
|
||||
// release must say so. The notice used to be gated on the version
|
||||
|
||||
Reference in new issue
Block a user