frostfs-node/pkg/core/version/version_test.go
Alex Vanin 20de74a505 Rename package name
Due to source code relocation from GitHub.

Signed-off-by: Alex Vanin <a.vanin@yadro.com>
2023-03-07 16:38:26 +03:00

30 lines
651 B
Go

package version_test
import (
"testing"
"git.frostfs.info/TrueCloudLab/frostfs-node/pkg/core/version"
versionSDK "git.frostfs.info/TrueCloudLab/frostfs-sdk-go/version"
"github.com/stretchr/testify/require"
)
func TestIsValid(t *testing.T) {
require.True(t, version.IsValid(versionSDK.Current()))
var v versionSDK.Version
for _, item := range []struct {
mjr, mnr uint32
valid bool
}{
{mjr: 0, mnr: 0, valid: false},
{mjr: 2, mnr: 6, valid: false},
{mjr: 2, mnr: 7, valid: true},
{mjr: 3, mnr: 0, valid: true},
} {
v.SetMajor(item.mjr)
v.SetMinor(item.mnr)
require.Equal(t, item.valid, version.IsValid(v), item)
}
}