Skip to content

Commit

Permalink
Add more isequal tests for Schema
Browse files Browse the repository at this point in the history
  • Loading branch information
sgilmore10 committed Sep 7, 2023
1 parent 0ed2677 commit 0fd75b4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions matlab/test/arrow/tabular/tSchema.m
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,11 @@ function TestIsEqualTrue(testCase)
arrow.field("B", arrow.uint16), ...
arrow.field("123", arrow.uint32)
]);
schema3 = arrow.recordBatch(table).Schema;
schema4 = arrow.recordBatch(table).Schema;

testCase.verifyTrue(isequal(schema1, schema2));
testCase.verifyTrue(isequal(schema3, schema4));
end

function TestIsEqualFalse(testCase)
Expand All @@ -506,9 +510,19 @@ function TestIsEqualFalse(testCase)
arrow.field("C", arrow.uint8), ...
arrow.field("B", arrow.uint16), ...
]);
schema5 = arrow.recordBatch(table).Schema;

% Have different number of fields
testCase.verifyFalse(isequal(schema1, schema2));

% Field properties are not equal
testCase.verifyFalse(isequal(schema2, schema3));
testCase.verifyFalse(isequal(schema2, schema4));
testCase.verifyFalse(isequal(schema4, schema5));

% Compare schema to double
testCase.verifyFalse(isequal(schema4, 5));

end

end
Expand Down

0 comments on commit 0fd75b4

Please sign in to comment.