Correct assertion messages and improve coverage

Following a recent normative change to the Resizable ArrayBuffer
proposal [1], the term "out of bounds" no longer applies to
"length-tracking" TypedArrays whose underlying ArrayBuffer has been
resized to match their byte offset.

Reflect this in the tests by renaming the condition from "out of bounds"
to "on boundary" and by adding new assertions for true "out of bounds"
conditions.

[1] https://github.com/tc39/proposal-resizablearraybuffer/pull/70
This commit is contained in:
Mike Pennisi 2021-09-22 22:27:09 -04:00 committed by Rick Waldron
parent 1b72bcd857
commit e6b64517a4
2 changed files with 14 additions and 0 deletions

View File

@ -42,5 +42,12 @@ testWithBigIntTypedArrayConstructors(function(TA) {
expected = 0;
} catch (_) {}
assert.sameValue(array.byteLength, expected, "following shrink (on boundary)");
try {
ab.resize(0);
expected = 0;
} catch (_) {}
assert.sameValue(array.byteLength, expected, "following shrink (out of bounds)");
});

View File

@ -42,5 +42,12 @@ testWithBigIntTypedArrayConstructors(function(TA) {
expected = 0;
} catch (_) {}
assert.sameValue(array.length, expected, "following shrink (on boundary)");
try {
ab.resize(0);
expected = 0;
} catch (_) {}
assert.sameValue(array.length, expected, "following shrink (out of bounds)");
});