@@ -118,6 +118,19 @@ Describe 'tests for function expressions' {
118
118
@ { expression = " [intersection(parameters('thirdObject'), parameters('fourthObject'))]" ; expected = [pscustomobject ]@ { three = ' d' } }
119
119
@ { expression = " [intersection(parameters('firstArray'), parameters('thirdArray'))]" ; expected = @ () }
120
120
@ { expression = " [intersection(parameters('firstObject'), parameters('firstArray'))]" ; isError = $true }
121
+ # Test with 3 arrays - should find common elements across all three
122
+ @ { expression = " [intersection(parameters('firstArray'), parameters('secondArray'), parameters('fifthArray'))]" ; expected = @ (' cd' ) }
123
+ # Test with 3 objects - should find properties with matching key-value pairs across all three
124
+ @ { expression = " [intersection(parameters('firstObject'), parameters('secondObject'), parameters('sixthObject'))]" ; expected = [pscustomobject ]@ { two = ' b' } }
125
+ # Test with nested objects - should match deep equality
126
+ @ { expression = " [intersection(parameters('nestedObject1'), parameters('nestedObject2'))]" ; expected = [pscustomobject ]@ {
127
+ shared = [pscustomobject ]@ { value = 42 ; flag = $true }
128
+ level = 1
129
+ } }
130
+ # Test with nested objects - no common nested properties
131
+ @ { expression = " [intersection(parameters('nestedObject1'), parameters('nestedObject3'))]" ; expected = [pscustomobject ]@ { level = 1 } }
132
+ # Test with 3 nested objects
133
+ @ { expression = " [intersection(parameters('nestedObject1'), parameters('nestedObject2'), parameters('nestedObject4'))]" ; expected = [pscustomobject ]@ { level = 1 } }
121
134
) {
122
135
param ($expression , $expected , $isError )
123
136
@@ -144,6 +157,42 @@ Describe 'tests for function expressions' {
144
157
defaultValue:
145
158
three: d
146
159
four: e
160
+ sixthObject:
161
+ type: object
162
+ defaultValue:
163
+ two: b
164
+ five: f
165
+ nestedObject1:
166
+ type: object
167
+ defaultValue:
168
+ shared:
169
+ value: 42
170
+ flag: true
171
+ level: 1
172
+ unique1: test
173
+ nestedObject2:
174
+ type: object
175
+ defaultValue:
176
+ shared:
177
+ value: 42
178
+ flag: true
179
+ level: 1
180
+ unique2: test
181
+ nestedObject3:
182
+ type: object
183
+ defaultValue:
184
+ shared:
185
+ value: 24
186
+ flag: true
187
+ level: 1
188
+ unique3: test
189
+ nestedObject4:
190
+ type: object
191
+ defaultValue:
192
+ level: 1
193
+ different:
194
+ value: 100
195
+ flag: false
147
196
firstArray:
148
197
type: array
149
198
defaultValue:
@@ -165,6 +214,11 @@ Describe 'tests for function expressions' {
165
214
- gh
166
215
- ef
167
216
- ij
217
+ fifthArray:
218
+ type: array
219
+ defaultValue:
220
+ - cd
221
+ - kl
168
222
resources:
169
223
- name: Echo
170
224
type: Microsoft.DSC.Debug/Echo
0 commit comments