forked from cory/tildefriends
quickjs-2021-03-27.tar.xz
git-svn-id: https://www.unprompted.com/svn/projects/tildefriends/trunk@3649 ed5197a5-7fde-0310-b194-c3ffbd925b24
This commit is contained in:
11
deps/quickjs/tests/test_builtin.js
vendored
11
deps/quickjs/tests/test_builtin.js
vendored
@ -399,7 +399,7 @@ function test_eval()
|
||||
|
||||
function test_typed_array()
|
||||
{
|
||||
var buffer, a, i;
|
||||
var buffer, a, i, str;
|
||||
|
||||
a = new Uint8Array(4);
|
||||
assert(a.length, 4);
|
||||
@ -438,8 +438,13 @@ function test_typed_array()
|
||||
a[0] = 1;
|
||||
|
||||
a = new Uint8Array(buffer);
|
||||
|
||||
assert(a.toString(), "0,0,255,255,0,0,0,0,0,0,128,63,255,255,255,255");
|
||||
|
||||
str = a.toString();
|
||||
/* test little and big endian cases */
|
||||
if (str !== "0,0,255,255,0,0,0,0,0,0,128,63,255,255,255,255" &&
|
||||
str !== "0,0,255,255,0,0,0,0,63,128,0,0,255,255,255,255") {
|
||||
assert(false);
|
||||
}
|
||||
|
||||
assert(a.buffer, buffer);
|
||||
|
||||
|
Reference in New Issue
Block a user