Compare commits
1
Commits
next
...
6da4315f57
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6da4315f57 |
No files matched your search
@@ -38,7 +38,7 @@ func writeVersion(out *ui.Writer) {
|
|||||||
|
|
||||||
_, _ = fmt.Fprintf(w, "vaultik %s\n", globals.Version)
|
_, _ = fmt.Fprintf(w, "vaultik %s\n", globals.Version)
|
||||||
_, _ = fmt.Fprintf(w, " commit: %s\n", globals.Commit)
|
_, _ = fmt.Fprintf(w, " commit: %s\n", globals.Commit)
|
||||||
_, _ = fmt.Fprintf(w, " build date: %s\n", globals.CommitDate)
|
_, _ = fmt.Fprintf(w, " commit date: %s\n", globals.CommitDate)
|
||||||
_, _ = fmt.Fprintf(w, " go: %s\n", runtime.Version())
|
_, _ = fmt.Fprintf(w, " go: %s\n", runtime.Version())
|
||||||
_, _ = fmt.Fprintf(w, " os/arch: %s/%s\n", runtime.GOOS, runtime.GOARCH)
|
_, _ = fmt.Fprintf(w, " os/arch: %s/%s\n", runtime.GOOS, runtime.GOARCH)
|
||||||
_, _ = fmt.Fprintf(w, " author: %s\n", globals.Author)
|
_, _ = fmt.Fprintf(w, " author: %s\n", globals.Author)
|
||||||
|
|||||||
@@ -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
|
// TestVersionCommandFlagsDevelopmentBuild is the regression test for
|
||||||
// the thing this command exists to prevent: a build that is not a
|
// 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
|
// release must say so. The notice used to be gated on the version
|
||||||
|
|||||||
Reference in new issue
Block a user