import (
"github.com/stretchr/testify/assert"
"io"
- "reflect"
"testing"
)
t.Errorf("MarshalBinary() error = %v, wantErr %v", err, tt.wantErr)
return
}
- if !reflect.DeepEqual(gotData, tt.wantData) {
+ if !assert.Equal(t, tt.wantData, gotData) {
t.Errorf("MarshalBinary() gotData = %v, want %v", gotData, tt.wantData)
}
})
"encoding/binary"
"github.com/stretchr/testify/assert"
"io"
- "reflect"
"testing"
)
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
- if got := NewFileHeader(tt.args.fileName, tt.args.isDir); !reflect.DeepEqual(got, tt.want) {
+ if got := NewFileHeader(tt.args.fileName, tt.args.isDir); !assert.Equal(t, tt.want, got) {
t.Errorf("NewFileHeader() = %v, want %v", got, tt.want)
}
})
FilePath: tt.fields.FilePath,
}
got, _ := io.ReadAll(fh)
- if !reflect.DeepEqual(got, tt.want) {
+ if !assert.Equal(t, tt.want, got) {
t.Errorf("Read() = %v, want %v", got, tt.want)
}
})
import (
"bytes"
"encoding/binary"
+ "github.com/stretchr/testify/assert"
"os"
"path/filepath"
- "reflect"
"testing"
)
t.Errorf("CalcTotalSize() error = %v, wantErr %v", err, tt.wantErr)
return
}
- if !reflect.DeepEqual(got, tt.want) {
+ if !assert.Equal(t, tt.want, got) {
t.Errorf("CalcTotalSize() got = %v, want %v", got, tt.want)
}
})
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"io"
- "reflect"
"testing"
)
0x54, 0x65, 0x73, 0x74, 0x20, 0x53, 0x65, 0x72, 0x76,
0x04,
0x46, 0x6f, 0x6f, 0x7a,
+ 0x00,
},
},
}
Description: tt.fields.Description,
}
- if got, _ := io.ReadAll(tr); !reflect.DeepEqual(got, tt.want) {
+ if got, _ := io.ReadAll(tr); !assert.Equal(t, tt.want, got) {
t.Errorf("Read() = %v, want %v", got, tt.want)
}
})