Skip to content

Commit f44eed0

Browse files
committed
Fix version unit tests
1 parent 9faa1c4 commit f44eed0

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

main.go

+8-6
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,13 @@ import (
2727
"github.com/cidertool/cider/cmd"
2828
)
2929

30+
const licenseDisclaimer = `
31+
Copyright (C) 2020 Aaron Sky
32+
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
33+
34+
This is free software; you are free to change and redistribute it.
35+
There is NO WARRANTY, to the extent permitted by law.`
36+
3037
// nolint: gochecknoglobals
3138
var (
3239
version = "dev"
@@ -59,10 +66,5 @@ func buildVersion(version, commit, date, builtBy string) string {
5966
result = fmt.Sprintf("%s\nbuilt by: %s", result, builtBy)
6067
}
6168

62-
return result + `
63-
Copyright (C) 2020 Aaron Sky
64-
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
65-
66-
This is free software; you are free to change and redistribute it.
67-
There is NO WARRANTY, to the extent permitted by law.`
69+
return result + licenseDisclaimer
6870
}

main_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func TestVersion(t *testing.T) {
6060
tt := tt
6161

6262
t.Run(name, func(t *testing.T) {
63-
assert.Equal(t, tt.out, buildVersion(tt.version, tt.commit, tt.date, tt.builtBy))
63+
assert.Equal(t, tt.out+licenseDisclaimer, buildVersion(tt.version, tt.commit, tt.date, tt.builtBy))
6464
})
6565
}
6666
}

0 commit comments

Comments
 (0)