diff --git a/matlab/test/arrow/array/tStructArray.m b/matlab/test/arrow/array/tStructArray.m index 53b43b74d47be..639df65befbf5 100644 --- a/matlab/test/arrow/array/tStructArray.m +++ b/matlab/test/arrow/array/tStructArray.m @@ -227,7 +227,9 @@ function toMATLAB(tc) % in the StructArray are set to the type-specific null values. valid = [1 2 5]; array = StructArray.fromArrays(tc.Float64Array, tc.StringArray, FieldNames=["X", "Y"], Valid=valid); - expectedTable([3 4], :) = repmat({NaN string(missing)}, [2 1]); + float64NullValue = tc.Float64Array.NullSubstitutionValue; + stringNullValue = tc.StringArray.NullSubstitutionValue; + expectedTable([3 4], :) = repmat({float64NullValue stringNullValue}, [2 1]); actualTable = toMATLAB(array); tc.verifyEqual(actualTable, expectedTable); end @@ -244,7 +246,9 @@ function table(tc) % in the StructArray are set to the type-specific null values. valid = [1 2 5]; array = StructArray.fromArrays(tc.Float64Array, tc.StringArray, FieldNames=["X", "Y"], Valid=valid); - expectedTable([3 4], :) = repmat({NaN string(missing)}, [2 1]); + float64NullValue = tc.Float64Array.NullSubstitutionValue; + stringNullValue = tc.StringArray.NullSubstitutionValue; + expectedTable([3 4], :) = repmat({float64NullValue stringNullValue}, [2 1]); actualTable = toMATLAB(array); tc.verifyEqual(actualTable, expectedTable); end @@ -263,7 +267,9 @@ function IsEqualFalse(tc) array1 = StructArray.fromArrays(tc.Float64Array, tc.StringArray, FieldNames=["X", "Y"]); array2 = StructArray.fromArrays(tc.StringArray, tc.Float64Array, FieldNames=["X", "Y"]); array3 = StructArray.fromArrays(tc.Float64Array, tc.StringArray, FieldNames=["A", "B"]); + % StructArrays have the same FieldNames but the Fields have different types. tc.verifyFalse(isequal(array1, array2)); + % Fields of the StructArrays have the same types but the StructArrays have different FieldNames. tc.verifyFalse(isequal(array1, array3)); end