tests/testthat/test-mmap.R

context("File mapping")

# testing the C-Level functions

test_that("mmapping of inexistent file returns List-NA", {
  expect_warning(fd<-CWmisc_mmap("nothere.txt"),"File not found.")
  testthat::expect_null(fd[1][[1]])
  testthat::expect_is(fd,"list")
})

test_that("mmapping of empty file returns List-NA", {
  expect_warning(fd<-CWmisc_mmap("empty.txt"),"File is empty.")
  testthat::expect_null(fd[1][[1]])
  testthat::expect_is(fd,"list")
})

Try the Wmisc package in your browser

Any scripts or data that you put into this service are public.

Wmisc documentation built on Jan. 14, 2018, 1:04 a.m.