check / check (push) Waiting to run
`mfer version`, `mfer --version` and the banner print the revision the build stamps into main.Gitrev or, when it stamped none (as after `go install` of a tag), the main module's version from runtime/debug.ReadBuildInfo. The banner no longer shows a release date. mfer.Version and mfer.ReleaseDate go, with main.Version and the version field and parameter in internal/cli that nothing read. A program using the library reads the module version from its own build information. The README says where the version comes from. Judgement call: a binary with no build information, or none holding a module version, prints "unknown", the word script/build already uses when git describe gives nothing. Model: opus-5-5
25 lines
533 B
Go
25 lines
533 B
Go
package main
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/stretchr/testify/assert"
|
|
)
|
|
|
|
// TestAppname pins the program name that main passes to cli.Run; it is
|
|
// the name that appears in usage output and in the log prefix. It also
|
|
// keeps this package compiled under `go test`.
|
|
func TestAppname(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
assert.Equal(t, "mfer", Appname)
|
|
}
|
|
|
|
// TestGitrevDefault documents that Gitrev is empty unless injected at build
|
|
// time via -ldflags.
|
|
func TestGitrevDefault(t *testing.T) {
|
|
t.Parallel()
|
|
|
|
assert.Empty(t, Gitrev)
|
|
}
|