jonkeane commented on a change in pull request #12567:
URL: https://github.com/apache/arrow/pull/12567#discussion_r824282914



##########
File path: r/tests/testthat/test-record-batch-reader.R
##########
@@ -157,3 +157,31 @@ test_that("reader head method edge cases", {
   expect_equal(head(reader, 0), Table$create(x = integer(0), y = character(0)))
   expect_equal(head(reader, 100), Table$create(batch, batch))
 })
+
+test_that("RBR methods", {
+  batch <- record_batch(
+    x = 1:10,
+    y = letters[1:10]
+  )
+  sink <- BufferOutputStream$create()
+  writer <- RecordBatchStreamWriter$create(sink, batch$schema)
+  writer$write(batch)
+  writer$write(batch)
+  writer$close()
+  buf <- sink$finish()
+
+  reader <- RecordBatchStreamReader$create(buf)
+  expect_output(
+    print(reader),
+    "RecordBatchStreamReader
+x: int32
+y: string"
+  )

Review comment:
       I will say, this kind of test is a good usecase for `expect_snapshot()`. 
We don't need to change it, but it makes looking at the output much nicer than 
dealing with embedded newlines + tabs.




-- 
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