From 5750e2fa7ce383074536a961b87f2e7800d419e6 Mon Sep 17 00:00:00 2001 From: Kevin Gurney Date: Tue, 29 Aug 2023 14:35:25 -0400 Subject: [PATCH] Add Date32Traits tests. --- matlab/test/arrow/type/traits/tDate32Traits.m | 33 +++++++++++++++++++ matlab/test/arrow/type/traits/ttraits.m | 14 +++++++- 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 matlab/test/arrow/type/traits/tDate32Traits.m diff --git a/matlab/test/arrow/type/traits/tDate32Traits.m b/matlab/test/arrow/type/traits/tDate32Traits.m new file mode 100644 index 0000000000000..6f3c07c99d774 --- /dev/null +++ b/matlab/test/arrow/type/traits/tDate32Traits.m @@ -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 diff --git a/matlab/test/arrow/type/traits/ttraits.m b/matlab/test/arrow/type/traits/ttraits.m index 771562152a5ef..70508a5e7cfbf 100644 --- a/matlab/test/arrow/type/traits/ttraits.m +++ b/matlab/test/arrow/type/traits/ttraits.m @@ -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.* @@ -352,4 +364,4 @@ function TestErrorIfUnsupportedInputType(testCase) end -end \ No newline at end of file +end