Open connerk opened 6 years ago
quick fix without editing the vba-test library is to run all multi-dimensional arrays through this
Public Function ArrayToFlatCollection(a As Variant) As Collection
Dim c As New Collection
Dim item As Variant
If VBA.TypeName(a) Like "*()" Then
For Each item In a
c.Add item
Next item
Else
c.Add a
End If
Set ArrayToFlatCollection = c
End Function
as such
Tests.test("range should contain value").Includes ArrayToFlatCollection(myRange.value2), "myValue"
example test:
an error occurs because
myRange.Value2
is a 2 dimensional array.in
ArrayIncludes()
, called byIncludes()
VBA.IsArray(Value(i))
causes an error if Value() is multidimensional