diff options
| author | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2024-06-08 20:36:04 -0700 |
|---|---|---|
| committer | Jeff Halter <868228+jhalter@users.noreply.github.com> | 2024-06-09 14:05:15 -0700 |
| commit | b129b7cbc9fd9a9c11a77e5922861ef08893efa1 (patch) | |
| tree | 1e3687d1c96fb54bcac1d9c13cdac4297976a758 /hotline/file_name_with_info_test.go | |
| parent | 9c44621ee1ca9abfca79c593e80193afd9204c83 (diff) | |
Convert bespoke methods to io.Reader/io.Writer interfaces
Diffstat (limited to 'hotline/file_name_with_info_test.go')
| -rw-r--r-- | hotline/file_name_with_info_test.go | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/hotline/file_name_with_info_test.go b/hotline/file_name_with_info_test.go index 1637a64..0473631 100644 --- a/hotline/file_name_with_info_test.go +++ b/hotline/file_name_with_info_test.go @@ -2,6 +2,7 @@ package hotline import ( "github.com/stretchr/testify/assert" + "io" "reflect" "testing" ) @@ -48,7 +49,7 @@ func TestFileNameWithInfo_MarshalBinary(t *testing.T) { fileNameWithInfoHeader: tt.fields.fileNameWithInfoHeader, name: tt.fields.name, } - gotData, err := f.MarshalBinary() + gotData, err := io.ReadAll(f) if (err != nil) != tt.wantErr { t.Errorf("MarshalBinary() error = %v, wantErr %v", err, tt.wantErr) return @@ -108,7 +109,7 @@ func TestFileNameWithInfo_UnmarshalBinary(t *testing.T) { fileNameWithInfoHeader: tt.fields.fileNameWithInfoHeader, name: tt.fields.name, } - if err := f.UnmarshalBinary(tt.args.data); (err != nil) != tt.wantErr { + if _, err := f.Write(tt.args.data); (err != nil) != tt.wantErr { t.Errorf("Write() error = %v, wantErr %v", err, tt.wantErr) } if !assert.Equal(t, tt.want, f) { |