Skip to content

Commit

Permalink
Add Date32Traits tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevingurney committed Aug 29, 2023
1 parent 33e56d6 commit 5750e2f
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 1 deletion.
33 changes: 33 additions & 0 deletions matlab/test/arrow/type/traits/tDate32Traits.m
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
%TDATE32TRAITS Unit tests for arrow.type.traits.Date32Traits

% Licensed to the Apache Software Foundation (ASF) under one or more
% contributor license agreements. See the NOTICE file distributed with
% this work for additional information regarding copyright ownership.
% The ASF licenses this file to you under the Apache License, Version
% 2.0 (the "License"); you may not use this file except in compliance
% with the License. You may obtain a copy of the License at
%
% http://www.apache.org/licenses/LICENSE-2.0
%
% Unless required by applicable law or agreed to in writing, software
% distributed under the License is distributed on an "AS IS" BASIS,
% WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
% implied. See the License for the specific language governing
% permissions and limitations under the License.

classdef tDate32Traits < hTypeTraits

properties
TraitsConstructor = @arrow.type.traits.Date32Traits
ArrayConstructor = @arrow.array.Date32Array
ArrayClassName = "arrow.array.Date32Array"
ArrayProxyClassName = "arrow.array.proxy.Date32Array"
ArrayStaticConstructor = @arrow.array.Date32Array.fromMATLAB
TypeConstructor = @arrow.type.Date32Type
TypeClassName = "arrow.type.Date32Type"
TypeProxyClassName = "arrow.type.proxy.Date32Type"
MatlabConstructor = @datetime
MatlabClassName = "datetime"
end

end
14 changes: 13 additions & 1 deletion matlab/test/arrow/type/traits/ttraits.m
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,18 @@ function TestTime64(testCase)
testCase.verifyEqual(actualTraits, expectedTraits);
end

function TestDate32(testCase)
import arrow.type.traits.*
import arrow.type.*

type = ID.Date32;
expectedTraits = Date32Traits();

actualTraits = traits(type);

testCase.verifyEqual(actualTraits, expectedTraits);
end

function TestMatlabUInt8(testCase)
import arrow.type.traits.*

Expand Down Expand Up @@ -352,4 +364,4 @@ function TestErrorIfUnsupportedInputType(testCase)

end

end
end

0 comments on commit 5750e2f

Please sign in to comment.