From a0b58c3a542f6253aec669db339796c69955eaf8 Mon Sep 17 00:00:00 2001 From: Kevin Gurney Date: Wed, 15 Jan 2025 16:12:03 -0500 Subject: [PATCH] Add test to verify that an error is thrown if a value that is not a Proxy object is supplied to the RecordBatchStreamReader constructor. --- matlab/test/arrow/io/ipc/tRecordBatchStreamReader.m | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/matlab/test/arrow/io/ipc/tRecordBatchStreamReader.m b/matlab/test/arrow/io/ipc/tRecordBatchStreamReader.m index 208a3c280a4cd..ad52726f3cb7a 100644 --- a/matlab/test/arrow/io/ipc/tRecordBatchStreamReader.m +++ b/matlab/test/arrow/io/ipc/tRecordBatchStreamReader.m @@ -361,6 +361,14 @@ function ErrorIfNotIpcStreamFile(testCase, RecordBatchStreamReaderConstructorFcn testCase.verifyError(fcn, "arrow:io:ipc:FailedToOpenRecordBatchReader"); end + function ErrorIfNotProxy(testCase) + % Verify the RecordBatchStreamReader constructor throws an exception + % with the identifier MATLAB:validation:UnableToConvert if the input + % is not a Proxy object. + fcn = @() arrow.io.ipc.RecordBatchStreamReader(testCase.RandomAccessFile); + testCase.verifyError(fcn, "MATLAB:validation:UnableToConvert"); + end + end end