Skip to content

Commit

Permalink
修改 md5 测试用例
Browse files Browse the repository at this point in the history
  • Loading branch information
carsonxu committed Feb 5, 2021
1 parent 888f50f commit 52403b8
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -867,9 +867,11 @@ group('putObject()', function () {
Bucket: config.Bucket,
Region: config.Region,
Key: Key,
BodyType: 'arraybuffer',
}, function (err, data) {
var isSame = unescape(encodeURIComponent(data.Body)).split(0).every(function (v, i) {
return v.charCodeAt(0) === arr[i]
var arr = new Uint8Array(data.Body);
var isSame = arr.every(function (v, i) {
return v === arr[i];
});
assert.ok(isSame && (data.headers && data.headers.etag) === ETag);
done();
Expand All @@ -896,9 +898,11 @@ group('putObject()', function () {
Bucket: config.Bucket,
Region: config.Region,
Key: Key,
BodyType: 'arraybuffer',
}, function (err, data) {
var isSame = unescape(encodeURIComponent(data.Body)).split(0).every(function (v, i) {
return v.charCodeAt(0) === arr[i];
var arr = new Uint8Array(data.Body);
var isSame = arr.every(function (v, i) {
return v === arr[i];
});
assert.ok(isSame && (data.headers && data.headers.etag) === ETag);
done();
Expand Down

0 comments on commit 52403b8

Please sign in to comment.