File: test-stdin.R

package info (click to toggle)
r-cran-sys 3.4.3-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 220 kB
  • sloc: ansic: 540; sh: 13; makefile: 2
file content (13 lines) | stat: -rw-r--r-- 339 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
context("test-stdin")

test_that("streaming from stdin works", {
  tmp <- tempfile()
  input <- c("foo", "bar", "baz")
  writeLines(input, con = tmp)
  res <- exec_internal('sort', std_in = tmp)
  expect_equal(res$status, 0)
  con <- rawConnection(res$stdout)
  output <- readLines(con)
  close(con)
  expect_equal(output, sort(input))
})