Skip to content

Commit

Permalink
Test 0x1 and 1x0 empty char inputs to field method.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevingurney committed Aug 3, 2023
1 parent 3c36398 commit 40c00e1
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions matlab/test/arrow/tabular/tSchema.m
Original file line number Diff line number Diff line change
Expand Up @@ -406,17 +406,30 @@ function GetFieldByNameWithChar(testCase)

% Should match the first field whose name is the
% empty string ("").
field = schema.field('');
fieldName = char.empty(0, 0);
field = schema.field(fieldName);
testCase.verifyEqual(field.Name, "");
testCase.verifyEqual(field.Type.ID, arrow.type.ID.UInt8);

fieldName = char.empty(0, 1);
field = schema.field(fieldName);
testCase.verifyEqual(field.Name, "");
testCase.verifyEqual(field.Type.ID, arrow.type.ID.UInt8);

fieldName = char.empty(1, 0);
field = schema.field(fieldName);
testCase.verifyEqual(field.Name, "");
testCase.verifyEqual(field.Type.ID, arrow.type.ID.UInt8);

% Should match the second field whose name is "B".
field = schema.field('B');
fieldName = 'B';
field = schema.field(fieldName);
testCase.verifyEqual(field.Name, "B");
testCase.verifyEqual(field.Type.ID, arrow.type.ID.UInt16);

% Should match the second field whose name is "123".
field = schema.field('123');
fieldName = '123';
field = schema.field(fieldName);
testCase.verifyEqual(field.Name, "123");
testCase.verifyEqual(field.Type.ID, arrow.type.ID.UInt32);
end
Expand Down

0 comments on commit 40c00e1

Please sign in to comment.