14514f5e3Sopenharmony_ci# Copyright (c) 2024 Huawei Device Co., Ltd. 24514f5e3Sopenharmony_ci# Licensed under the Apache License, Version 2.0 (the "License"); 34514f5e3Sopenharmony_ci# you may not use this file except in compliance with the License. 44514f5e3Sopenharmony_ci# You may obtain a copy of the License at 54514f5e3Sopenharmony_ci# 64514f5e3Sopenharmony_ci# http://www.apache.org/licenses/LICENSE-2.0 74514f5e3Sopenharmony_ci# 84514f5e3Sopenharmony_ci# Unless required by applicable law or agreed to in writing, software 94514f5e3Sopenharmony_ci# distributed under the License is distributed on an "AS IS" BASIS, 104514f5e3Sopenharmony_ci# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 114514f5e3Sopenharmony_ci# See the License for the specific language governing permissions and 124514f5e3Sopenharmony_ci# limitations under the License. 134514f5e3Sopenharmony_ci 144514f5e3Sopenharmony_ci===Basic test begin=== 154514f5e3Sopenharmony_ciset size is 5 164514f5e3Sopenharmony_citrue 174514f5e3Sopenharmony_citrue 184514f5e3Sopenharmony_cifalse 194514f5e3Sopenharmony_cikeys next:0, done: false 204514f5e3Sopenharmony_cikeys next:1, done: false 214514f5e3Sopenharmony_cikeys next:2, done: false 224514f5e3Sopenharmony_cikeys next:3, done: false 234514f5e3Sopenharmony_cikeys next:4, done: false 244514f5e3Sopenharmony_cikeys next:undefined, done: true 254514f5e3Sopenharmony_civalues next:0, done: false 264514f5e3Sopenharmony_civalues next:1, done: false 274514f5e3Sopenharmony_civalues next:2, done: false 284514f5e3Sopenharmony_civalues next:3, done: false 294514f5e3Sopenharmony_civalues next:4, done: false 304514f5e3Sopenharmony_civalues next:undefined, done: true 314514f5e3Sopenharmony_ciset key[forEach]:key:0, value:0 324514f5e3Sopenharmony_ciset key[forEach]:key:1, value:1 334514f5e3Sopenharmony_ciset key[forEach]:key:2, value:2 344514f5e3Sopenharmony_ciset key[forEach]:key:3, value:3 354514f5e3Sopenharmony_ciset key[forEach]:key:4, value:4 364514f5e3Sopenharmony_citrue 374514f5e3Sopenharmony_ciset key[Symbol.iterator]:0 384514f5e3Sopenharmony_ciset key[Symbol.iterator]:1 394514f5e3Sopenharmony_ciset key[Symbol.iterator]:2 404514f5e3Sopenharmony_ciset key[Symbol.iterator]:3 414514f5e3Sopenharmony_ciset key[Symbol.iterator]:4 424514f5e3Sopenharmony_citrue 434514f5e3Sopenharmony_citrue 444514f5e3Sopenharmony_citrue 454514f5e3Sopenharmony_citrue 464514f5e3Sopenharmony_cifalse 474514f5e3Sopenharmony_citrue 484514f5e3Sopenharmony_citrue 494514f5e3Sopenharmony_cifalse 504514f5e3Sopenharmony_citrue 514514f5e3Sopenharmony_citrue 524514f5e3Sopenharmony_ciadd extension(.): TypeError: Cannot add property in prevent extensions 534514f5e3Sopenharmony_ciadd extension([]): TypeError: Cannot add property in prevent extensions 544514f5e3Sopenharmony_ci===Basic test end=== 554514f5e3Sopenharmony_ci===Concurrent modification during iteration Test(iterator) begin=== 564514f5e3Sopenharmony_ciset size is 5 574514f5e3Sopenharmony_ciset key[for-of]: 0 584514f5e3Sopenharmony_ciset key[for-of]: 1 594514f5e3Sopenharmony_ciset key[for-of]: 2 604514f5e3Sopenharmony_ciset key[for-of]: 3 614514f5e3Sopenharmony_ciset key[for-of]: 4 624514f5e3Sopenharmony_ciAdd Scenario[for-of] updated size: 6 634514f5e3Sopenharmony_ciDelete Scenario[for-of] updated size: 2 644514f5e3Sopenharmony_ciClear Scenario[for-of] updated size: 0 654514f5e3Sopenharmony_ciset size is 5 664514f5e3Sopenharmony_ciAdd Scenario[next()] updated size: 6 674514f5e3Sopenharmony_ciDelete Scenario[next()] updated size: 5 684514f5e3Sopenharmony_ciClear Scenario[next()] updated size: 0 694514f5e3Sopenharmony_ci===Concurrent modification during iteration Test(iterator) end=== 704514f5e3Sopenharmony_ci===Concurrent modification during iteration Test(forEach) begin=== 714514f5e3Sopenharmony_ciset size is 5 724514f5e3Sopenharmony_ciset key[forEach]: 0 734514f5e3Sopenharmony_ciset key[forEach]: 1 744514f5e3Sopenharmony_ciset key[forEach]: 2 754514f5e3Sopenharmony_ciset key[forEach]: 3 764514f5e3Sopenharmony_ciset key[forEach]: 4 774514f5e3Sopenharmony_ciAdd Scenario[forEach]: BusinessError: Concurrent modification exception, errCode: 10200201 784514f5e3Sopenharmony_ciDelete Scenario[forEach]: BusinessError: Concurrent modification exception, errCode: 10200201 794514f5e3Sopenharmony_ciClear Scenario[forEach]: BusinessError: Concurrent modification exception, errCode: 10200201 804514f5e3Sopenharmony_ci===Concurrent modification during iteration Test(forEach) end=== 814514f5e3Sopenharmony_ci===Type check begin=== 824514f5e3Sopenharmony_cisharedSet add[shared] element success 834514f5e3Sopenharmony_cisharedSet add[unshared]: BusinessError: Parameter error. Only accept sendable value., errCode: 401 844514f5e3Sopenharmony_cisharedSet add[unshared]: BusinessError: Parameter error. Only accept sendable value., errCode: 401 854514f5e3Sopenharmony_ci===Type check end=== 864514f5e3Sopenharmony_ci===Class inheritance test begin === 874514f5e3Sopenharmony_citrue 884514f5e3Sopenharmony_ci1 894514f5e3Sopenharmony_citrue 904514f5e3Sopenharmony_citrue 914514f5e3Sopenharmony_citrue 924514f5e3Sopenharmony_ci3 934514f5e3Sopenharmony_ciSubSendableSet add[unshared]: BusinessError: Parameter error. Only accept sendable value., errCode: 401 944514f5e3Sopenharmony_ciSubSendableSet key[for-of]: one 954514f5e3Sopenharmony_ciSubSendableSet key[for-of]: two 964514f5e3Sopenharmony_ciSubSendableSet key[for-of]: three 974514f5e3Sopenharmony_ci4 984514f5e3Sopenharmony_ciSubSendableSet Delete Scenario[forEach]: BusinessError: Concurrent modification exception, errCode: 10200201 994514f5e3Sopenharmony_citrue 1004514f5e3Sopenharmony_citrue 1014514f5e3Sopenharmony_citrue 1024514f5e3Sopenharmony_ci3 1034514f5e3Sopenharmony_ciadd extension(.): TypeError: Cannot add property in prevent extensions 1044514f5e3Sopenharmony_ciadd extension([]): TypeError: Cannot add property in prevent extensions 1054514f5e3Sopenharmony_ciSubSubSendableSet add[unshared]: BusinessError: Parameter error. Only accept sendable value., errCode: 401 1064514f5e3Sopenharmony_ciSubSubSendableSet Delete Scenario[forEach]: BusinessError: Concurrent modification exception, errCode: 10200201 1074514f5e3Sopenharmony_ci=== An iterable object to convert to an ArkTS Set begin=== 1084514f5e3Sopenharmony_ciset key[forEach]: 0 1094514f5e3Sopenharmony_ciset key[forEach]: 1 1104514f5e3Sopenharmony_ciset key[forEach]: 2 1114514f5e3Sopenharmony_ciset key[forEach]: 3 1124514f5e3Sopenharmony_ciset key[forEach]: 4 1134514f5e3Sopenharmony_ci===Class inheritance test end === 114