• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2024 Huawei Device Co., Ltd.
2# Licensed under the Apache License, Version 2.0 (the "License");
3# you may not use this file except in compliance with the License.
4# You may obtain a copy of the License at
5#
6#     http://www.apache.org/licenses/LICENSE-2.0
7#
8# Unless required by applicable law or agreed to in writing, software
9# distributed under the License is distributed on an "AS IS" BASIS,
10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
14===Basic test begin===
15map size is 5
16true
17true
18false
19keys next:0, done: false
20keys next:1, done: false
21keys next:2, done: false
22keys next:3, done: false
23keys next:4, done: false
24keys next:undefined, done: true
25values next:value0, done: false
26values next:value1, done: false
27values next:value2, done: false
28values next:value3, done: false
29values next:value4, done: false
30values next:undefined, done: true
31map key[forEach]:key:0, value:value0
32map key[forEach]:key:1, value:value1
33map key[forEach]:key:2, value:value2
34map key[forEach]:key:3, value:value3
35map key[forEach]:key:4, value:value4
36true
37map key[Symbol.iterator]:0,value0
38map key[Symbol.iterator]:1,value1
39map key[Symbol.iterator]:2,value2
40map key[Symbol.iterator]:3,value3
41map key[Symbol.iterator]:4,value4
42map entries:[0, value0]
43map entries:[1, value1]
44map entries:[2, value2]
45map entries:[3, value3]
46map entries:[4, value4]
47true
48false
49false
50true
51true
52false
53true
54true
55true
56false
57true
58true
59===Basic test end===
60===Concurrent modification during iteration Test(iterator) begin===
61map size is 5
62map key[for-of]: 0
63map key[for-of]: 1
64map key[for-of]: 2
65map key[for-of]: 3
66map key[for-of]: 4
67Set Scenario[for-of] updated size: 6
68Delete Scenario[for-of] updated size: 2
69Clear Scenario[for-of] updated size: 0
70map size is 5
71Set Scenario[next()] updated size: 6
72Delete Scenario[next()] updated size: 5
73Clear Scenario[next()] updated size: 0
74===Concurrent modification during iteration Test(iterator) end===
75===Concurrent modification during iteration Test(forEach) begin===
76map size is 5
77map key[forEach]: 0
78map key[forEach]: 1
79map key[forEach]: 2
80map key[forEach]: 3
81map key[forEach]: 4
82Set Scenario[forEach]: BusinessError: Concurrent modification exception, errCode: 10200201
83Delete Scenario[forEach]: BusinessError: Concurrent modification exception, errCode: 10200201
84Clear Scenario[forEach]: BusinessError: Concurrent modification exception, errCode: 10200201
85===Concurrent modification during iteration Test(forEach) end===
86===Type check begin===
87sharedMap set[shared] element success
88sharedMap set[unshared]: BusinessError: Parameter error. Only accept sendable value., errCode: 401
89sharedMap set[unshared]: BusinessError: Parameter error. Only accept sendable value., errCode: 401
90===Type check end===
91===Class inheritance test begin ===
92true
931
94add extension(.): TypeError: Cannot add property in prevent extensions
95add extension([]): TypeError: Cannot add property in prevent extensions
96SubSendableMap set[unshared]: BusinessError: Parameter error. Only accept sendable value., errCode: 401
973
98SubSendableMap [key, value][for-of]: [1, one]
99SubSendableMap [key, value][for-of]: [2, two]
100SubSendableMap [key, value][for-of]: [3, three]
101SubSendableMap Delete Scenario[forEach]: BusinessError: Concurrent modification exception, errCode: 10200201
102true
1031
104SubSubSendableMap set[unshared]: BusinessError: Parameter error. Only accept sendable value., errCode: 401
1053
106SubSubSendableMap [key, value][for-of]: [1, one]
107SubSubSendableMap [key, value][for-of]: [2, two]
108SubSubSendableMap [key, value][for-of]: [3, three]
109SubSubSendableMap Delete Scenario[forEach]: BusinessError: Concurrent modification exception, errCode: 10200201
110=== An iterable object to convert to an ArkTS Map begin===
111map size is 5
112map key[forEach]:key:0, value:value0
113map key[forEach]:key:1, value:value1
114map key[forEach]:key:2, value:value2
115map key[forEach]:key:3, value:value3
116map key[forEach]:key:4, value:value4
117===Class inheritance test end ===
118