kevingurney commented on code in PR #38531:
URL: https://github.com/apache/arrow/pull/38531#discussion_r1377939417


##########
matlab/test/arrow/array/tListArray.m:
##########
@@ -160,6 +184,81 @@ function TestErrorIfEmptyOffsets(testCase)
             testCase.verifyError(fcn, "arrow:array:ListArrayFromArraysFailed");
         end
 
+        function TestValidationModeDefault(testCase, TestValidationModeArray)
+            % Verify that the default ValidationMode value for the
+            % arrow.array.ListArray.fromArrays method is
+            % arrow.array.ValidationMode.Minimal.
+            offsets = TestValidationModeArray.Offsets;
+            values = TestValidationModeArray.Values;
+            valid = TestValidationModeArray.Valid;
+            fcn = @() arrow.array.ListArray.fromArrays(offsets, values);
+            if ~valid
+                testCase.verifyError(fcn, "arrow:array:ValidateMinimalFailed");
+            end
+        end
+
+        function TestValidationModeNone(testCase, TestValidationModeArray)
+            % Verify that no error is thrown when supplying the
+            % ValidatationMode name-value pair, with a value of
+            % arrow.array.ValidationMode.None, to the
+            % arrow.array.ListArray.fromArrays method.
+            offsets = TestValidationModeArray.Offsets;
+            values = TestValidationModeArray.Values;
+            validationMode = arrow.array.ValidationMode.None;
+            fcn = @() arrow.array.ListArray.fromArrays(offsets, values, 
ValidationMode=validationMode);
+            testCase.verifyWarningFree(fcn);
+        end
+
+        function TestValidationModeMinimal(testCase, TestValidationModeArray)
+            % Verify that an error of type arrow:array:ValidateMinimalFailed
+            % is thrown when supplying the ValidatationMode name-value pair,
+            % with a value of arrow.array.ValidationMode.Minimal, to the
+            % arrow.array.ListArray.fromArrays method, if the provided offsets
+            % and values arrays are invalid.
+            offsets = TestValidationModeArray.Offsets;
+            values = TestValidationModeArray.Values;
+            valid = TestValidationModeArray.Valid;
+            validationMode = arrow.array.ValidationMode.Minimal;
+            fcn = @() arrow.array.ListArray.fromArrays(offsets, values, 
ValidationMode=validationMode);
+            if ~valid
+                testCase.verifyError(fcn, "arrow:array:ValidateMinimalFailed");
+            end
+        end
+
+        function TestValidationModeFull(testCase, TestValidationModeArray)
+            % Verify that an error of type arrow:array:ValidateFullFailed
+            % is thrown when supplying the ValidatationMode name-value pair,
+            % with a value of arrow.array.ValidationMode.Full, to the
+            % arrow.array.ListArray.fromArrays method, if the provided offsets
+            % and values arrays are invalid.
+            offsets = TestValidationModeArray.Offsets;
+            values = TestValidationModeArray.Values;
+            validationMode = arrow.array.ValidationMode.Full;
+            valid = TestValidationModeArray.Valid;
+            fcn = @() arrow.array.ListArray.fromArrays(offsets, values, 
ValidationMode=validationMode);
+            if ~valid

Review Comment:
   Fixed. Called `verifyWarningFree` for the `valid` case.



##########
matlab/test/arrow/array/tListArray.m:
##########
@@ -160,6 +184,81 @@ function TestErrorIfEmptyOffsets(testCase)
             testCase.verifyError(fcn, "arrow:array:ListArrayFromArraysFailed");
         end
 
+        function TestValidationModeDefault(testCase, TestValidationModeArray)
+            % Verify that the default ValidationMode value for the
+            % arrow.array.ListArray.fromArrays method is
+            % arrow.array.ValidationMode.Minimal.
+            offsets = TestValidationModeArray.Offsets;
+            values = TestValidationModeArray.Values;
+            valid = TestValidationModeArray.Valid;
+            fcn = @() arrow.array.ListArray.fromArrays(offsets, values);
+            if ~valid
+                testCase.verifyError(fcn, "arrow:array:ValidateMinimalFailed");
+            end
+        end
+
+        function TestValidationModeNone(testCase, TestValidationModeArray)
+            % Verify that no error is thrown when supplying the
+            % ValidatationMode name-value pair, with a value of
+            % arrow.array.ValidationMode.None, to the
+            % arrow.array.ListArray.fromArrays method.
+            offsets = TestValidationModeArray.Offsets;
+            values = TestValidationModeArray.Values;
+            validationMode = arrow.array.ValidationMode.None;
+            fcn = @() arrow.array.ListArray.fromArrays(offsets, values, 
ValidationMode=validationMode);
+            testCase.verifyWarningFree(fcn);
+        end
+
+        function TestValidationModeMinimal(testCase, TestValidationModeArray)
+            % Verify that an error of type arrow:array:ValidateMinimalFailed
+            % is thrown when supplying the ValidatationMode name-value pair,
+            % with a value of arrow.array.ValidationMode.Minimal, to the
+            % arrow.array.ListArray.fromArrays method, if the provided offsets
+            % and values arrays are invalid.
+            offsets = TestValidationModeArray.Offsets;
+            values = TestValidationModeArray.Values;
+            valid = TestValidationModeArray.Valid;
+            validationMode = arrow.array.ValidationMode.Minimal;
+            fcn = @() arrow.array.ListArray.fromArrays(offsets, values, 
ValidationMode=validationMode);
+            if ~valid

Review Comment:
   Fixed. Called `verifyWarningFree` for the `valid` case.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to