mirror of https://github.com/tc39/test262.git
assert on the length of the backing buffer of the result
This commit is contained in:
parent
44803f799c
commit
080c5490a2
|
@ -21,5 +21,7 @@ var standardBase64Vectors = [
|
|||
standardBase64Vectors.forEach(function (pair) {
|
||||
var arr = Uint8Array.fromBase64(pair[0]);
|
||||
assert.sameValue(Object.getPrototypeOf(arr), Uint8Array.prototype, "decoding " + pair[0]);
|
||||
assert.sameValue(arr.length, pair[1].length, "decoding " + pair[0]);
|
||||
assert.sameValue(arr.buffer.byteLength, pair[1].length, "decoding " + pair[0]);
|
||||
assert.compareArray(arr, pair[1], "decoding " + pair[0]);
|
||||
});
|
||||
|
|
|
@ -16,5 +16,7 @@ var whitespaceKinds = [
|
|||
];
|
||||
whitespaceKinds.forEach(function(pair) {
|
||||
var arr = Uint8Array.fromBase64(pair[0]);
|
||||
assert.sameValue(arr.length, 1);
|
||||
assert.sameValue(arr.buffer.byteLength, 1);
|
||||
assert.compareArray(arr, [102], "ascii whitespace: " + pair[1]);
|
||||
});
|
||||
|
|
|
@ -22,5 +22,7 @@ var cases = [
|
|||
cases.forEach(function (pair) {
|
||||
var arr = Uint8Array.fromHex(pair[0]);
|
||||
assert.sameValue(Object.getPrototypeOf(arr), Uint8Array.prototype, "decoding " + pair[0]);
|
||||
assert.sameValue(arr.length, pair[1].length, "decoding " + pair[0]);
|
||||
assert.sameValue(arr.buffer.byteLength, pair[1].length, "decoding " + pair[0]);
|
||||
assert.compareArray(arr, pair[1], "decoding " + pair[0]);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue