-
Notifications
You must be signed in to change notification settings - Fork 22
/
Copy pathtest_issue81.R
24 lines (21 loc) · 980 Bytes
/
test_issue81.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
## This issue actually only affects ods files created by Excel.
## excel_repeat.ods is created with MS Office 365 online
test_that("issue 81, correctness", {
res <- read_ods("../testdata/excel_repeat.ods", col_names = FALSE, as_tibble = FALSE)
expect_identical(res[,1], c(rep("A", 12), rep("C", 11)))
expect_identical(res[,2], c(rep("B", 12), rep("D", 11)))
res <- read_ods("../testdata/excel_repeat.ods", col_names = FALSE)
expect_identical(res[[1]], c(rep("A", 12), rep("C", 11)))
expect_identical(res[[2]], c(rep("B", 12), rep("D", 11)))
})
test_that("issue 81 real test", {
skip_if(!file.exists("../testdata/issue81.ods"))
file <- "../testdata/issue81.ods"
res <- read_ods(file, sheet = 2, skip = 4, as_tibble = FALSE)
expect_equal(sum(is.na(res[,1])), 0)
})
test_that("issue 84", {
skip_if(!file.exists("../testdata/issue81.ods"))
file <- "../testdata/issue81.ods"
expect_error(read_ods(file, sheet = "Leavers"), NA)
})