test_that("Detect eCAP", { expect_equal(read_input("ecap1.csv")$format, "ecap1") expect_equal(read_input("ecap2.xls")$format, "ecap2xls") expect_equal(read_input("ecap2.csv")$format, "ecap2") expect_equal(read_input("ecap3.csv")$format, "ecap3") expect_equal(read_input("simplemed.csv")$format, "simplemed") expect_equal(read_input("mems.csv")$format, "mems") expect_equal(read_input("mems2.csv")$format, "mems2") expect_equal(read_input("adheretech.csv")$format, "adheretech") expect_equal(read_input("adheretech_2.csv")$format, "adheretech") # FIXME: NA patientid ok? expect_equal(read_input("adheretech.xlsx")$format, "adheretechxls") expect_equal(read_input("noformat.csv")$format, NULL) })