Skip to content

Commit

Permalink
Add test point for arrow.array.Array.Length property.
Browse files Browse the repository at this point in the history
Co-authored-by: Sarah Gilmore <sgilmore@mathworks.com>
  • Loading branch information
kevingurney and sgilmore10 committed May 10, 2023
1 parent c32d901 commit 8645e1b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions matlab/test/arrow/array/tFloat64Array.m
Original file line number Diff line number Diff line change
Expand Up @@ -100,5 +100,22 @@ function ErrorIfSparse(testCase, MakeDeepCopy)
fcn = @() arrow.array.Float64Array(sparse(ones([10 1])), DeepCopy=MakeDeepCopy);
testCase.verifyError(fcn, "MATLAB:expectedNonsparse");
end

function Length(testCase, MakeDeepCopy)
% Zero length array
A = arrow.array.Float64Array([], DeepCopy=MakeDeepCopy);
expectedLength = int64(0);
testCase.verifyEqual(A.Length, expectedLength);

% Scalar
A = arrow.array.Float64Array(1, DeepCopy=MakeDeepCopy);
expectedLength = int64(1);
testCase.verifyEqual(A.Length, expectedLength);

% Vector
A = arrow.array.Float64Array(1:100, DeepCopy=MakeDeepCopy);
expectedLength = int64(100);
testCase.verifyEqual(A.Length, expectedLength);
end
end
end

0 comments on commit 8645e1b

Please sign in to comment.