# 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 Start Test pop poped: 44 Start Test randomUpdate 30 add element by index access failed. err: TypeError: Cannot add property in prevent extensions, code: undefined add element by index access failed. err: TypeError: Cannot add property 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 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 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 Start Test join Fire,Air,Water FireAirWater Fire-Air-Water FirenullAirnullWater Fire,Air,Water Start Test shift 2 2 undefined Start Test unshift 5 5 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 Start Test reduce 10 20 10 1 2 3 4 Start Test splice 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 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 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 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 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 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 Start Test EveryTest true false true true true true false false false false false false false false false false false 4 0 5 -1 -1 -1 2