tests/testthat/test-4-sample-2.R

if(interactive()) library(testthat)
sampleRoot <- system.file("sampledata", package = "sss")
filenameSSS <- file.path(sampleRoot, "sample-2.sss")
filenameASC <- file.path(sampleRoot, "sample-2.csv")

#------------------------------------------------------------------------------



test_that("parsing of .sss and .asc works", {
	test <- 
	  read.sss(filenameSSS, filenameASC)
	expect_s3_class(test,  "data.frame")
})

test_that("parsing works when you only provide the .sss", {
  expect_equal(get_sss_format(filenameSSS), ".csv")
  test <- read.sss(filenameSSS)
  expect_s3_class(test,  "data.frame")
  
  test_2 <- read.sss(filenameSSS, filenameASC)
  expect_equal(test, test_2)
  
})

Try the sss package in your browser

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

sss documentation built on Aug. 14, 2022, 5:05 p.m.