frostfs-api-go/pkg/version_test.go
Leonard Lyubich e0c34a51f2 [#140] sdk: Refactor version type
Signed-off-by: Leonard Lyubich <leonard@nspcc.ru>
2020-09-18 10:45:11 +03:00

31 lines
530 B
Go

package pkg
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestNewVersionFromV2(t *testing.T) {
v := NewVersion()
var mjr, mnr uint32 = 1, 2
v.SetMajor(mjr)
v.SetMinor(mnr)
require.Equal(t, mjr, v.GetMajor())
require.Equal(t, mnr, v.GetMinor())
ver := v.ToV2()
require.Equal(t, mjr, ver.GetMajor())
require.Equal(t, mnr, ver.GetMinor())
}
func TestSDKVersion(t *testing.T) {
v := SDKVersion()
require.Equal(t, uint32(sdkMjr), v.GetMajor())
require.Equal(t, uint32(sdkMnr), v.GetMinor())
}