Skip to content

Commit

Permalink
Updated a test method name and the way of setting a property used in …
Browse files Browse the repository at this point in the history
…test based on Kevin's review feedback
  • Loading branch information
leihou6116 committed Nov 15, 2023
1 parent 3abc1f4 commit ff64863
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 12 deletions.
8 changes: 2 additions & 6 deletions matlab/test/arrow/array/tTime32Array.m
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ function TestIsEqualFalseTimeUnitMistmatch(tc)
tc.verifyFalse(isequal(array1, array2));
end

function RoundTimeBySpecifyTimeUnit(tc)
function RoundTimeBySpecifiedTimeUnit(tc)
% Verify that the input parameter "TimeUnit" is used to specify
% the time resolution. The value is rounded off based on the
% specified "TimeUnit".
Expand All @@ -305,11 +305,7 @@ function TimeUnitIsReadOnly(tc)

matlabTimes = seconds([1.1, 1.4, 1.5, 1.9, 2.001]);
arrowArray = tc.ArrowArrayConstructorFcn(matlabTimes);
tc.verifyError(@()setTimeUnit(arrowArray),'MATLAB:class:SetProhibited');

function setTimeUnit(arrowTime)
arrowTime.Type.TimeUnit = "millisecond";
end
tc.verifyError(@()setfield(arrowArray.Type,"TimeUnit", "millisecond"),'MATLAB:class:SetProhibited');
end
end

Expand Down
8 changes: 2 additions & 6 deletions matlab/test/arrow/array/tTime64Array.m
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,7 @@ function TestIsEqualFalseTimeUnitMistmatch(tc)
tc.verifyFalse(isequal(array1, array2));
end

function RoundTimeBySpecifyTimeUnit(tc)
function RoundTimeBySpecifiedTimeUnit(tc)
% Verify that the input parameter "TimeUnit" is used to specify
% the time resolution. The value is rounded off based on the
% specified "TimeUnit".
Expand Down Expand Up @@ -364,11 +364,7 @@ function TimeUnitIsReadOnly(tc)

matlabTimes = seconds([1.000001, 2.999999, 0.0002004]);
arrowArray = tc.ArrowArrayConstructorFcn(matlabTimes);
tc.verifyError(@()setTimeUnit(arrowArray),'MATLAB:class:SetProhibited');

function setTimeUnit(arrowTime)
arrowTime.Type.TimeUnit = "Nanosecond";
end
tc.verifyError(@()setfield(arrowArray.Type,"TimeUnit", "Nanosecond"),'MATLAB:class:SetProhibited');
end
end

Expand Down

0 comments on commit ff64863

Please sign in to comment.