mirror of
https://github.com/mikefarah/yq.git
synced 2024-12-19 20:19:04 +00:00
Incrementing version
This commit is contained in:
parent
fb87f638f2
commit
d46d555b07
@ -16,7 +16,7 @@ var (
|
|||||||
// VersionPrerelease is a pre-release marker for the version. If this is "" (empty string)
|
// VersionPrerelease is a pre-release marker for the version. If this is "" (empty string)
|
||||||
// then it means that it is a final release. Otherwise, this is a pre-release
|
// then it means that it is a final release. Otherwise, this is a pre-release
|
||||||
// such as "dev" (in development), "beta", "rc1", etc.
|
// such as "dev" (in development), "beta", "rc1", etc.
|
||||||
VersionPrerelease = "beta"
|
VersionPrerelease = ""
|
||||||
)
|
)
|
||||||
|
|
||||||
// ProductName is the name of the product
|
// ProductName is the name of the product
|
||||||
|
@ -3,13 +3,18 @@ package main
|
|||||||
import "testing"
|
import "testing"
|
||||||
|
|
||||||
func TestGetVersionDisplay(t *testing.T) {
|
func TestGetVersionDisplay(t *testing.T) {
|
||||||
|
var expectedVersion = ProductName + " version " + Version
|
||||||
|
if VersionPrerelease != "" {
|
||||||
|
expectedVersion = expectedVersion + "-" + VersionPrerelease
|
||||||
|
}
|
||||||
|
expectedVersion = expectedVersion + "\n"
|
||||||
tests := []struct {
|
tests := []struct {
|
||||||
name string
|
name string
|
||||||
want string
|
want string
|
||||||
}{
|
}{
|
||||||
{
|
{
|
||||||
name: "Display Version",
|
name: "Display Version",
|
||||||
want: ProductName + " version " + Version + "-" + VersionPrerelease + "\n",
|
want: expectedVersion,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
for _, tt := range tests {
|
for _, tt := range tests {
|
||||||
|
Loading…
Reference in New Issue
Block a user