mirror of
https://github.com/lukaszraczylo/semver-generator.git
synced 2026-06-05 22:49:25 +00:00
49 lines
829 B
Go
49 lines
829 B
Go
package cmd
|
|
|
|
import (
|
|
"testing"
|
|
)
|
|
|
|
func Test_checkLatestRelease(t *testing.T) {
|
|
tests := []struct {
|
|
name string
|
|
want string
|
|
want1 bool
|
|
}{
|
|
{
|
|
name: "Check latest release",
|
|
want1: true,
|
|
},
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
_, got1 := checkLatestRelease()
|
|
if got1 != tt.want1 {
|
|
t.Errorf("checkLatestRelease() got1 = %v, want %v", got1, tt.want1)
|
|
}
|
|
})
|
|
}
|
|
}
|
|
|
|
func Test_updatePackage(t *testing.T) {
|
|
if testing.Short() {
|
|
t.Skip("Skipping test in short / CI mode")
|
|
}
|
|
tests := []struct {
|
|
name string
|
|
want bool
|
|
}{
|
|
{
|
|
name: "Run autoupdater",
|
|
want: true,
|
|
},
|
|
}
|
|
for _, tt := range tests {
|
|
t.Run(tt.name, func(t *testing.T) {
|
|
if got := updatePackage(); got != tt.want {
|
|
t.Errorf("updatePackage() = %v, want %v", got, tt.want)
|
|
}
|
|
})
|
|
}
|
|
}
|