Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cmwaters committed Aug 1, 2024
1 parent 6257209 commit 917541d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion share/blob_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ func TestNewBlobFromProto(t *testing.T) {
ShareVersion: 0,
Data: []byte{},
},
expectedErr: "blob data can not be empty",
expectedErr: "data can not be empty",
},
{
name: "invalid namespace ID length",
Expand Down
4 changes: 2 additions & 2 deletions share/share.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ func (s *Share) Version() uint8 {
return s.InfoByte().Version()
}

// doesSupportVersions checks if the share version is supported
func (s *Share) IsVersionSupported() error {
// CheckVersionSupported checks if the share version is supported
func (s *Share) CheckVersionSupported() error {
ver := s.Version()
if !bytes.Contains(SupportedShareVersions, []byte{ver}) {
return fmt.Errorf("unsupported share version %v is not present in the list of supported share versions %v", ver, SupportedShareVersions)
Expand Down
5 changes: 3 additions & 2 deletions share/share_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -222,8 +222,9 @@ func TestUnsupportedShareVersion(t *testing.T) {
rawShare := RandomNamespace().Bytes()
rawShare = append(rawShare, byte(infoByte))
rawShare = append(rawShare, bytes.Repeat([]byte{0}, ShareSize-len(rawShare))...)
_, err := NewShare(rawShare)
require.Error(t, err)
share, err := NewShare(rawShare)
require.NoError(t, err)
require.Error(t, share.CheckVersionSupported())
}

func TestShareToBytesAndFromBytes(t *testing.T) {
Expand Down

0 comments on commit 917541d

Please sign in to comment.