-
Notifications
You must be signed in to change notification settings - Fork 46
Expand file tree
/
Copy pathutils_test.go
More file actions
47 lines (44 loc) · 917 Bytes
/
utils_test.go
File metadata and controls
47 lines (44 loc) · 917 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
package updateutils
import (
"testing"
"github.com/logrusorgru/aurora/v4"
)
func TestGetVersionDescription(t *testing.T) {
Aurora = aurora.New(aurora.WithColors(false))
tests := []struct {
current string
latest string
want string
}{
{
current: "v2.9.1-dev",
latest: "v2.9.1",
want: "(outdated)",
},
{
current: "v2.9.1-dev",
latest: "v2.9.2",
want: "(outdated)",
},
{
current: "v2.9.1-dev",
latest: "v2.9.0",
want: "(development)",
},
{
current: "v2.9.1",
latest: "v2.9.1",
want: "(latest)",
},
{
current: "v2.9.1",
latest: "v2.9.2",
want: "(outdated)",
},
}
for _, test := range tests {
if GetVersionDescription(test.current, test.latest) != test.want {
t.Errorf("GetVersionDescription(%v, %v) = %v, want %v", test.current, test.latest, GetVersionDescription(test.current, test.latest), test.want)
}
}
}