# Copyright (c) 2024 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

Start Test at
An index of 2 returns 8
An index of -2 returns 130
An index of 200 returns undefined
An index of null returns 5
An index of undefined returns 5
An index of undefined returns 12
An index of undefined returns 5
An index of 2871622679 returns undefined
Start Test entries
0,a
1,b
2,c
Start Test keys
0
1
2
Start Test values
a
b
c
Start Test find
12
5
Start Test includes
true
true
false
Start Test index
3
Start Test fill
1,2,0,0
1,5,5,5
6,6,6,6
6,1,1,1
2,2,2,2
3,3,3,3
3,4,4,3
3,5,5,3
7,7,7,7
8,8,8,8
10,10,10,8
10,11,11,8
10,11,11,8
10,11,11,8
Start Test pop
70
5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50,80,90,150
5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50,80,90
5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50,80
5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50
5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100
5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30
5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20
5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10
5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44
5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130,44,10,20,30,100,50,80,90,150,200,5,12,8,130
60
Start Test randomUpdate
30
add element by index access failed. err: TypeError: Cannot add property "null" in prevent extensions, code: undefined
add element by index access failed. err: TypeError: Cannot add property "undefined" in prevent extensions, code: undefined
add element by index access failed. err: BusinessError: The value of index is out of range., code: 10200001
Start Test randomGet
5,12,8,130,44
Start Test randomAdd
add element by index access failed. err: BusinessError: The value of index is out of range., code: 10200001
Start Test create
Start Test from
A,B,C
E,,M,P,T,Y
Create from sendable undefined element list success. arr: ,,1
h,e,l,l,o
1,2,3
SA,SB,SC
SSA,SSB,SSC
Create from sendable array. err: BusinessError: Parameter error.Only accept sendable value., code: 401
1
1
1
4,3
4,3,2,6,4,3,4
abcdcde,bcdecde,cdefcde,cfghcde,abcdcdecde,bcdecdecde,cdefcdecde,cfghcdecde
1,3,5
Start Test fromTemplate
artTSTest1: 1,2,3
arkTSTest2: 1,2,3
Start Test length
Array length: 3
Array length after changed: 3
Start Test push
Elements pushed: 1,3,5,2,4,6
Elements pushed: 1,2,3,7,8,9
Start Test concat
1,3,5,2,4,6
1,3,5,2,4,6,100,101,102
1,3,5,200
1,3,5,201,202
1,3,5,
null
4
1,3,5,
undefined
4
1,3,5,1,,5
6
1,3,5,1,1,3,5,,5,
10
Start Test join
Fire,Air,Water
FireAirWater
Fire-Air-Water
FirenullAirnullWater
Fire,Air,Water
123,3445,789,
Start Test shift
2
2
undefined
2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70
49
4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70
6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70
100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70
50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70
60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70
70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70
2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70
4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70
6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70
100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70,2,4,6,100,50,60,70
39
Start Test unshift
1,2,3
3
5
4,5,1,2,3
5
4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3
35
4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3
70
36
4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3,4,5,1,2,3
36
Start Test slice
ant,bison,camel,duck,elephant
camel,duck,elephant
camel,duck
slice(1.5, 4) element success
bison,camel,duck
slice(8, 4) element success
slice(8, 100) element success
ant,bison,camel,duck,elephant
ant,bison,camel,duck,elephant
Start Test sort
Dec,Feb,Jan,March
1,10000,21,30,4
Start Test indexOf
1
4
-1
Start Test forEach
a
b
c
a[0] = a, a
a[1] = b, b
a[2] = c, c
Start Test map
2,8,18,32
Start Test filter
exuberant,destruction,present
5
8
44
spray,elite,exuberant,destruction,present,spray,elite,exuberant,destruction,present,spray,elite,exuberant,destruction,present,spray,elite,exuberant,destruction,present,spray,elite,exuberant,destruction,present,spray,elite,exuberant,destruction,present,spray,elite,exuberant,destruction,present,spray,elite,exuberant,destruction,present
destruction,destruction,destruction,destruction,destruction,destruction,destruction,destruction
Start Test reduce
10
20
10 1 2 3 4
Start Test splice

Jan,March,April,June
Jan,Feb,Oct,March,April,June
Jan,Feb,Oct,March,May
April,June
Jan,Feb
Oct,March,May
Add one element by splice api failed. err: BusinessError: Parameter error.Only accept sendable value., code: 401
Add one element by splice api failed. err: BusinessError: Parameter error.Only accept sendable value., code: 401
Start Test staticCreate
5,5,5,5,5,5,5,5,5,5
Create with without initialValue failed. err: BusinessError: Parameter error.Not enough parameters., code: 401
Create with negative length failed. err: BusinessError: Parameter error.Invalid array length., code: 401
Create huge sendableArrayWith initialValue success.
Create with exceed max length failed. err: BusinessError: Parameter error.Invalid array length., code: 401
Start Test readonlyLength
10
10
Start Test shrinkTo
10
Shrink to array.length: 5,5,5,5,5,5,5,5,5,5
Shrink to array.length + 1: 5,5,5,5,5,5,5,5,5,5
Shrink to -1 fail. err: BusinessError: Parameter error.Invalid array length., code: 401
Shrink to invalid 0x100000000 fail. err: BusinessError: Parameter error.Invalid array length., code: 401
1
5
Start Test growTo
5
ExtendTo to array.length: 5,5,5,5,5
ExtendTo to array.length - 1: 5,5,5,5,5
ExtendTo to 0: 5,5,5,5,5
ExtendTo to -1 fail. err: BusinessError: Parameter error.Invalid array length., code: 401
ExtendTo to invalid 0x100000000 fail. err: BusinessError: Parameter error.Invalid array length., code: 401
ExtendTo to 8 without initValue fail. err: BusinessError: Parameter error.Not enough parameters., code: 401
8
5,5,5,5,5,11,11,11
Start Test indexAccess
element1: 3
element1 assigned to 10: 10
Index access read out of range success.
Index access write out of range failed. err: BusinessError: The value of index is out of range., code: 10200001
write element while iterate array fail. err: BusinessError: Concurrent modification exception, errCode: 10200201
Start Test indexStringAccess
String index element1: 3
String index element1 assigned to 10: 10
String Index access read out of range success.
String Index access write out of range failed. err: BusinessError: The value of index is out of range., code: 10200001
String index write element while iterate array fail. err: BusinessError: Concurrent modification exception, errCode: 10200201
Start Test testForIC
[IC] Index access read in range success. array: 3
[IC] Index access write in range success.
[IC] assign readonly length no error.
[IC] Index access write out of range failed. err: BusinessError: The value of index is out of range., code: 10200001
Start Test testStringForIC
[IC] String Index access read in range success. array: 3
[IC] String Index access write in range success.
[IC] String Index access write out of range failed. err: BusinessError: The value of index is out of range., code: 10200001
Start Test arrayFrozenTest
arrayFrozenTest [new] single string. arr: ARK
Add prop to array failed. err: TypeError: Cannot add property "notExistProp" in prevent extensions
defineNotExistProp to array failed. err: TypeError: Cannot define property
Update function [at] failed. err: TypeError: Cannot assign to read only property
Update function [at] by defineProperty failed. err: TypeError: Cannot define property
arrayFrozenTest [new]. arr: A,R,K
Add prop to array failed. err: TypeError: Cannot add property "notExistProp" in prevent extensions
defineNotExistProp to array failed. err: TypeError: Cannot define property
Update function [at] failed. err: TypeError: Cannot assign to read only property
Update function [at] by defineProperty failed. err: TypeError: Cannot define property
arrayFrozenTest static [from]. arr: A,R,K
Add prop to array failed. err: TypeError: Cannot add property "notExistProp" in prevent extensions
defineNotExistProp to array failed. err: TypeError: Cannot define property
Update function [at] failed. err: TypeError: Cannot assign to read only property
Update function [at] by defineProperty failed. err: TypeError: Cannot define property
arrayFrozenTest static [create]. arr: A,A,A
Add prop to array failed. err: TypeError: Cannot add property "notExistProp" in prevent extensions
defineNotExistProp to array failed. err: TypeError: Cannot define property
Update function [at] failed. err: TypeError: Cannot assign to read only property
Update function [at] by defineProperty failed. err: TypeError: Cannot define property
Start Test sharedArrayFrozenTest
sharedArrayFrozenTest [new]. arr: A,R,K
Add prop to array failed. err: TypeError: Cannot add property "notExistProp" in prevent extensions
defineNotExistProp to array failed. err: TypeError: Cannot define property
Update function [at] failed. err: TypeError: Cannot assign to read only property
Update function [at] by defineProperty failed. err: TypeError: Cannot define property
Start Test arrayFromSet
Create from normal set: foo,bar,baz
Create from shared set: foo,bar,baz
Start Test arrayFromNormalMap
Start test arrayFromSendableMap
create from sharedMap with non-sendable array failed. err: BusinessError: Parameter error.Only accept sendable value., code: 401
create from sharedMapper.values(): a,b
create from sharedMapper.values(): 1,2
Start test arrayFromNotArray
NotArray called with length undefined
Create array from notArray failed. err: TypeError: Failed to construct the array., code: undefined
Start Test derivedSlice
instanceOf slice result: true
Start Test derivedSort
instanceOf derived sort result: true
Start Test derivedForEach
a[0] = March, true
a[1] = Jan, true
a[2] = Feb, true
a[3] = Dec, true
Start derivedMap
instanceOf derived map result: true
Start Test derivedFill
1,2,0,0
instanceOf derived fill result: true
Start Test array read out of range
array[0]: 1
read out of range success undefined
read out of range success 1
read out of range success 1
read out of range success undefined
read out of range success undefined
read out of range success undefined
read out of range success undefined
read out of range success undefined
read out of range success undefined
Start Test array for of
1
3
5
7
SendableArray ...from_arr: 1,2,3
SendableArray ...from_arr1: 0,1,2,3
Create from SendableArray with non-sendable array error failed. err: BusinessError: Parameter error.Only accept sendable value., code: 401
Start Test fromArrayConstructorTest
a,b,c
Start Test DefinePropertyTest
defineProperty to array success
defineProperty to array failed. err: BusinessError: Key out of length.
defineProperty to array success
defineProperty to array failed. err: BusinessError: Key out of length.
defineProperty to array failed. err: BusinessError: Key out of length.
defineProperty to array success 321
defineProperty to array failed. err: TypeError: Cannot define property, code: undefined
defineProperty to array failed. err: TypeError: Cannot define property, code: undefined
defineProperty to array failed. err: TypeError: Cannot define property, code: undefined
defineProperty to array failed. err: TypeError: Cannot define property, code: undefined
defineProperty to array failed. err: TypeError: Cannot define property, code: undefined
defineProperty to array failed. err: TypeError: Cannot define property, code: undefined
Start Test SomeTest
true
false
false
true
true
false
true
true
Start Test EveryTest
true
false
false
true
Start Test isArrayTest
true
true
true
true
false
false
false
false
false
false
false
false
false
false
false
Start Test lastIndexOf
4
0
5
-1
-1
-1
2
Start Test ofTest
1,2,3,4,2,5

1,2,3,4,5
Create SendableArray failed. err: BusinessError: Parameter error.Only accept sendable value., code: 401
Create SendableArray failed. err: TypeError: Failed to create Object., code: undefined
Start Test copyWithin
1,2,3,4,2,5
copyWithin SendableArray failed. err: BusinessError: Target index cannot be undefined., code: 10200011
1,1,2,3,4,2
1,1,3,4,2,2
1,1,3,3,4,2
1,1,3,3,4,2
1,1,3,3,4,2
Start Test findLast
130
undefined
findLast failed. err: TypeError: the predicate is not callable., code: undefined
44
Start Test findLastIndex
findLastIndex failed. err: TypeError: the predicate is not callable., code: undefined
find index1: 3
find index2: -1
4
Start Test reduceRight
10
20
10 4 3 2 1
NaN
1
undefined
reduceRight failed. err: TypeError: out of range., code: undefined
reduceRight failed. err: TypeError: the callbackfun is not callable., code: undefined
Start Test reverse
4,3,2,1
4,3,2,1
three,two,one
three,two,one
Start Test toString
1,2,3,4
one,two,three
,,3,4,5
Start Test toLocaleString
1,2,3,4
one,two,three
,,3,4,5
1.000,2.000,3.000,4.000,5.000
1 000,2 000,3 000,4 000,5 000
$123,456.79,$2,000.00
123.456,79 $,2.000,00 $
123.456,79 $,2.000,00 $,3,00 $,4,00 $,5,00 $
Start Test subSendableArrayTest
create SubSendableArray failed. err: TypeError: Callable is false, code: undefined
An index of 1 returns 12
An index of 2871622679 returns undefined
false
12
5
12
8
130
44
0
1
2
3
4
findIndex failed. err: TypeError: the predicate is not callable., code: undefined
5,12,0,0,44
4
5,12,0,0,10
slice element failed. err: TypeError: Callable is false, code: undefined
undefined


undefined
-1
undefined
false
-1

[object Array Iterator]

undefined
__proto__ call reduce error



0
[object SharedArray Iterator]
undefined
__proto__ call extendTo error
__proto__ call splice error
true
false
-1

undefined

undefined
-1
1,2,3,4
1
👨,‍,👩,‍,👧,‍,👦,❤,️,🇨,🇳
🐎,👱,❤
H,e,l,l,o
é,ñ,ü
你,好,世,界
😀,🎉
A,😀,Z
你,😀,好
👨,👩,👧,👦
🎉,p,a,r,t,y
p,a,r,t,y,🎉
🐎
中
α,β,γ
а,б,в
ا,ب,ت
∀,∃,∅
e,́
𝄞